Comparable domain such as all Integer
instances. A discrete domain is one that supports the three basic operations: next,
previous and distance, according to their specifications. The methods minValue and maxValue should also be overridden for bounded types.
A discrete domain always represents the entire set of values of its type; it cannot represent partial domains such as "prime integers" or "strings of length 5."
See the Guava User Guide section on DiscreteDomain.
| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final boolean |
| Access | Constructor and Description |
|---|---|
| protected | |
| private | DiscreteDomain(boolean supportsFastOffset)
Private constructor for built-in DiscreteDomains supporting fast offset. |
| Modifier and Type | Method and Description |
|---|---|
| public static DiscreteDomain | |
| public abstract long | Returns: the distance as described above, orLong#MIN_VALUE or Long#MAX_VALUE if
the distance is too small or too large, respectively.Returns a signed value indicating how many nested invocations of |
| public static DiscreteDomain | |
| public static DiscreteDomain | |
| public C | Returns: the maximum value of typeC; never nullReturns the maximum value of type |
| public C | Returns: the minimum value of typeC; never nullReturns the minimum value of type |
| public abstract C | Returns: the least value greater thanvalue, or null if value is maxValue()any value of type value)CReturns the unique least value of type |
| pack-priv C | |
| public abstract C | Returns: the greatest value less thanvalue, or null if value is minValue()any value of type value)CReturns the unique greatest value of type |
| supportsFastOffset | back to summary |
|---|---|
| pack-priv final boolean supportsFastOffset | |
| DiscreteDomain | back to summary |
|---|---|
| protected DiscreteDomain() Constructor for use by subclasses. | |
| DiscreteDomain | back to summary |
|---|---|
| private DiscreteDomain(boolean supportsFastOffset) Private constructor for built-in DiscreteDomains supporting fast offset. | |
| bigIntegers | back to summary |
|---|---|
| public static DiscreteDomain Returns the discrete domain for values of type This method always returns the same object. That object is serializable; deserializing it results in the same object too.
| |
| distance | back to summary |
|---|---|
| public abstract long distance(C start, C end) Returns a signed value indicating how many nested invocations of Note that this function is necessarily well-defined for any discrete type.
| |
| integers | back to summary |
|---|---|
| public static DiscreteDomain Returns the discrete domain for values of type This method always returns the same object. That object is serializable; deserializing it results in the same object too.
| |
| longs | back to summary |
|---|---|
| public static DiscreteDomain Returns the discrete domain for values of type This method always returns the same object. That object is serializable; deserializing it results in the same object too.
| |
| maxValue | back to summary |
|---|---|
| public C maxValue() Returns the maximum value of type The default implementation throws
| |
| minValue | back to summary |
|---|---|
| public C minValue() Returns the minimum value of type The default implementation throws
| |
| next | back to summary |
|---|---|
| public abstract C next(C value) Returns the unique least value of type
| |
| offset | back to summary |
|---|---|
| pack-priv C offset(C origin, long distance) Returns, conceptually, "origin + distance", or equivalently, the result of calling | |
| previous | back to summary |
|---|---|
| public abstract C previous(C value) Returns the unique greatest value of type
| |
| Modifier and Type | Field and Description |
|---|---|
| private static final DiscreteDomain. | |
| private static final BigInteger | |
| private static final BigInteger | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | distance(BigInteger start, BigInteger end)
Implements abstract com. next (if positive) or
previous (if negative) are needed to reach end starting from start.
|
| public BigInteger | next(BigInteger
any value of type value)CImplements abstract com. C that is greater than value, or null if none exists.
|
| pack-priv BigInteger | offset(BigInteger origin, long distance)
Overrides com. next on origin distance times.
|
| public BigInteger | previous(BigInteger
any value of type value)CImplements abstract com. C that is less than value, or null if none exists.
|
| private Object | |
| public String |
| INSTANCE | back to summary |
|---|---|
| private static final DiscreteDomain. | |
| MAX_LONG | back to summary |
|---|---|
| private static final BigInteger MAX_LONG | |
| MIN_LONG | back to summary |
|---|---|
| private static final BigInteger MIN_LONG | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| BigIntegerDomain | back to summary |
|---|---|
| pack-priv BigIntegerDomain() | |
| distance | back to summary |
|---|---|
| public long distance(BigInteger start, BigInteger end) Implements abstract com. Doc from com. Returns a signed value indicating how many nested invocations of Note that this function is necessarily well-defined for any discrete type.
| |
| next | back to summary |
|---|---|
| public BigInteger next(BigInteger value) Implements abstract com. Doc from com. Returns the unique least value of type
| |
| offset | back to summary |
|---|---|
| pack-priv BigInteger offset(BigInteger origin, long distance) Overrides com. Doc from com. Returns, conceptually, "origin + distance", or equivalently, the result of calling
| |
| previous | back to summary |
|---|---|
| public BigInteger previous(BigInteger value) Implements abstract com. Doc from com. Returns the unique greatest value of type
| |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final DiscreteDomain. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public Integer | maxValue()
Overrides com. C, if it has one.
|
| public Integer | minValue()
Overrides com. C, if it has one.
|
| public Integer | next(Integer
any value of type value)CImplements abstract com. C that is greater than value, or null if none exists.
|
| pack-priv Integer | offset(Integer origin, long distance)
Overrides com. next on origin distance times.
|
| public Integer | previous(Integer
any value of type value)CImplements abstract com. C that is less than value, or null if none exists.
|
| private Object | |
| public String |
| INSTANCE | back to summary |
|---|---|
| private static final DiscreteDomain. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| IntegerDomain | back to summary |
|---|---|
| pack-priv IntegerDomain() | |
| distance | back to summary |
|---|---|
| public long distance(Integer start, Integer end) Implements abstract com. Doc from com. Returns a signed value indicating how many nested invocations of Note that this function is necessarily well-defined for any discrete type.
| |
| maxValue | back to summary |
|---|---|
| public Integer maxValue() Overrides com. Doc from com. Returns the maximum value of type The default implementation throws | |
| minValue | back to summary |
|---|---|
| public Integer minValue() Overrides com. Doc from com. Returns the minimum value of type The default implementation throws | |
| next | back to summary |
|---|---|
| public Integer next(Integer value) Implements abstract com. Doc from com. Returns the unique least value of type | |
| offset | back to summary |
|---|---|
| pack-priv Integer offset(Integer origin, long distance) Overrides com. Doc from com. Returns, conceptually, "origin + distance", or equivalently, the result of calling
| |
| previous | back to summary |
|---|---|
| public Integer previous(Integer value) Implements abstract com. Doc from com. Returns the unique greatest value of type | |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final DiscreteDomain. | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public long | |
| public Long | maxValue()
Overrides com. C, if it has one.
|
| public Long | minValue()
Overrides com. C, if it has one.
|
| public Long | next(Long
any value of type value)CImplements abstract com. C that is greater than value, or null if none exists.
|
| pack-priv Long | offset(Long origin, long distance)
Overrides com. next on origin distance times.
|
| public Long | previous(Long
any value of type value)CImplements abstract com. C that is less than value, or null if none exists.
|
| private Object | |
| public String |
| INSTANCE | back to summary |
|---|---|
| private static final DiscreteDomain. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID | |
| LongDomain | back to summary |
|---|---|
| pack-priv LongDomain() | |
| distance | back to summary |
|---|---|
| public long distance(Long start, Long end) Implements abstract com. Doc from com. Returns a signed value indicating how many nested invocations of Note that this function is necessarily well-defined for any discrete type.
| |
| maxValue | back to summary |
|---|---|
| public Long maxValue() Overrides com. Doc from com. Returns the maximum value of type The default implementation throws | |
| minValue | back to summary |
|---|---|
| public Long minValue() Overrides com. Doc from com. Returns the minimum value of type The default implementation throws | |
| next | back to summary |
|---|---|
| public Long next(Long value) Implements abstract com. Doc from com. Returns the unique least value of type | |
| offset | back to summary |
|---|---|
| pack-priv Long offset(Long origin, long distance) Overrides com. Doc from com. Returns, conceptually, "origin + distance", or equivalently, the result of calling
| |
| previous | back to summary |
|---|---|
| public Long previous(Long value) Implements abstract com. Doc from com. Returns the unique greatest value of type | |
| readResolve | back to summary |
|---|---|
| private Object readResolve() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |