Class DiscreteDomain.BigIntegerDomain

  • All Implemented Interfaces:
    java.io.Serializable
    Enclosing class:
    DiscreteDomain<C extends java.lang.Comparable>

    private static final class DiscreteDomain.BigIntegerDomain
    extends DiscreteDomain<java.math.BigInteger>
    implements java.io.Serializable
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long distance​(java.math.BigInteger start, java.math.BigInteger end)
      Returns a signed value indicating how many nested invocations of DiscreteDomain.next(C) (if positive) or DiscreteDomain.previous(C) (if negative) are needed to reach end starting from start.
      java.math.BigInteger next​(java.math.BigInteger value)
      Returns the unique least value of type C that is greater than value, or null if none exists.
      (package private) java.math.BigInteger offset​(java.math.BigInteger origin, long distance)
      Returns, conceptually, "origin + distance", or equivalently, the result of calling DiscreteDomain.next(C) on origin distance times.
      java.math.BigInteger previous​(java.math.BigInteger value)
      Returns the unique greatest value of type C that is less than value, or null if none exists.
      private java.lang.Object readResolve()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • MIN_LONG

        private static final java.math.BigInteger MIN_LONG
      • MAX_LONG

        private static final java.math.BigInteger MAX_LONG
    • Constructor Detail

      • BigIntegerDomain

        BigIntegerDomain()
    • Method Detail

      • next

        public java.math.BigInteger next​(java.math.BigInteger value)
        Description copied from class: DiscreteDomain
        Returns the unique least value of type C that is greater than value, or null if none exists. Inverse operation to DiscreteDomain.previous(C).
        Specified by:
        next in class DiscreteDomain<java.math.BigInteger>
        Parameters:
        value - any value of type C
        Returns:
        the least value greater than value, or null if value is maxValue()
      • previous

        public java.math.BigInteger previous​(java.math.BigInteger value)
        Description copied from class: DiscreteDomain
        Returns the unique greatest value of type C that is less than value, or null if none exists. Inverse operation to DiscreteDomain.next(C).
        Specified by:
        previous in class DiscreteDomain<java.math.BigInteger>
        Parameters:
        value - any value of type C
        Returns:
        the greatest value less than value, or null if value is minValue()
      • offset

        java.math.BigInteger offset​(java.math.BigInteger origin,
                                    long distance)
        Description copied from class: DiscreteDomain
        Returns, conceptually, "origin + distance", or equivalently, the result of calling DiscreteDomain.next(C) on origin distance times.
        Overrides:
        offset in class DiscreteDomain<java.math.BigInteger>
      • distance

        public long distance​(java.math.BigInteger start,
                             java.math.BigInteger end)
        Description copied from class: DiscreteDomain
        Returns a signed value indicating how many nested invocations of DiscreteDomain.next(C) (if positive) or DiscreteDomain.previous(C) (if negative) are needed to reach end starting from start. For example, if end = next(next(next(start))), then distance(start, end) == 3 and distance(end, start) == -3. As well, distance(a, a) is always zero.

        Note that this function is necessarily well-defined for any discrete type.

        Specified by:
        distance in class DiscreteDomain<java.math.BigInteger>
        Returns:
        the distance as described above, or Long.MIN_VALUE or Long.MAX_VALUE if the distance is too small or too large, respectively.
      • readResolve

        private java.lang.Object readResolve()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object