Package com.google.common.collect
Class DiscreteDomain.BigIntegerDomain
java.lang.Object
com.google.common.collect.DiscreteDomain<BigInteger>
com.google.common.collect.DiscreteDomain.BigIntegerDomain
- All Implemented Interfaces:
Serializable
- Enclosing class:
- DiscreteDomain<C extends Comparable>
private static final class DiscreteDomain.BigIntegerDomain
extends DiscreteDomain<BigInteger>
implements Serializable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DiscreteDomain.BigIntegerDomainprivate static final BigIntegerprivate static final BigIntegerprivate static final longFields inherited from class com.google.common.collect.DiscreteDomain
supportsFastOffset -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlongdistance(BigInteger start, BigInteger end) Returns a signed value indicating how many nested invocations ofDiscreteDomain.next(C)(if positive) orDiscreteDomain.previous(C)(if negative) are needed to reachendstarting fromstart.next(BigInteger value) Returns the unique least value of typeCthat is greater thanvalue, ornullif none exists.(package private) BigIntegeroffset(BigInteger origin, long distance) Returns, conceptually, "origin + distance", or equivalently, the result of callingDiscreteDomain.next(C)onorigindistancetimes.previous(BigInteger value) Returns the unique greatest value of typeCthat is less thanvalue, ornullif none exists.private ObjecttoString()Methods inherited from class com.google.common.collect.DiscreteDomain
bigIntegers, integers, longs, maxValue, minValue
-
Field Details
-
INSTANCE
-
MIN_LONG
-
MAX_LONG
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
BigIntegerDomain
BigIntegerDomain()
-
-
Method Details
-
next
Description copied from class:DiscreteDomainReturns the unique least value of typeCthat is greater thanvalue, ornullif none exists. Inverse operation toDiscreteDomain.previous(C).- Specified by:
nextin classDiscreteDomain<BigInteger>- Parameters:
value- any value of typeC- Returns:
- the least value greater than
value, ornullifvalueismaxValue()
-
previous
Description copied from class:DiscreteDomainReturns the unique greatest value of typeCthat is less thanvalue, ornullif none exists. Inverse operation toDiscreteDomain.next(C).- Specified by:
previousin classDiscreteDomain<BigInteger>- Parameters:
value- any value of typeC- Returns:
- the greatest value less than
value, ornullifvalueisminValue()
-
offset
Description copied from class:DiscreteDomainReturns, conceptually, "origin + distance", or equivalently, the result of callingDiscreteDomain.next(C)onorigindistancetimes.- Overrides:
offsetin classDiscreteDomain<BigInteger>
-
distance
Description copied from class:DiscreteDomainReturns a signed value indicating how many nested invocations ofDiscreteDomain.next(C)(if positive) orDiscreteDomain.previous(C)(if negative) are needed to reachendstarting fromstart. For example, ifend = next(next(next(start))), thendistance(start, end) == 3anddistance(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:
distancein classDiscreteDomain<BigInteger>- Returns:
- the distance as described above, or
Long.MIN_VALUEorLong.MAX_VALUEif the distance is too small or too large, respectively.
-
readResolve
-
toString
-