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.BigIntegerDomain
private static final BigInteger
private static final BigInteger
private static final long
Fields inherited from class com.google.common.collect.DiscreteDomain
supportsFastOffset
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
distance
(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 reachend
starting fromstart
.next
(BigInteger value) Returns the unique least value of typeC
that is greater thanvalue
, ornull
if none exists.(package private) BigInteger
offset
(BigInteger origin, long distance) Returns, conceptually, "origin + distance", or equivalently, the result of callingDiscreteDomain.next(C)
onorigin
distance
times.previous
(BigInteger value) Returns the unique greatest value of typeC
that is less thanvalue
, ornull
if none exists.private Object
toString()
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:DiscreteDomain
Returns the unique least value of typeC
that is greater thanvalue
, ornull
if none exists. Inverse operation toDiscreteDomain.previous(C)
.- Specified by:
next
in classDiscreteDomain<BigInteger>
- Parameters:
value
- any value of typeC
- Returns:
- the least value greater than
value
, ornull
ifvalue
ismaxValue()
-
previous
Description copied from class:DiscreteDomain
Returns the unique greatest value of typeC
that is less thanvalue
, ornull
if none exists. Inverse operation toDiscreteDomain.next(C)
.- Specified by:
previous
in classDiscreteDomain<BigInteger>
- Parameters:
value
- any value of typeC
- Returns:
- the greatest value less than
value
, ornull
ifvalue
isminValue()
-
offset
Description copied from class:DiscreteDomain
Returns, conceptually, "origin + distance", or equivalently, the result of callingDiscreteDomain.next(C)
onorigin
distance
times.- Overrides:
offset
in classDiscreteDomain<BigInteger>
-
distance
Description copied from class:DiscreteDomain
Returns a signed value indicating how many nested invocations ofDiscreteDomain.next(C)
(if positive) orDiscreteDomain.previous(C)
(if negative) are needed to reachend
starting fromstart
. For example, ifend = next(next(next(start)))
, thendistance(start, end) == 3
anddistance(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 classDiscreteDomain<BigInteger>
- Returns:
- the distance as described above, or
Long.MIN_VALUE
orLong.MAX_VALUE
if the distance is too small or too large, respectively.
-
readResolve
-
toString
-