org.feijoas.mango.common.collect
Returns a signed value indicating how many nested invocations of
#next
(if positive) or #previous
(if negative) are needed to reach
end
starting from start
.
Returns a signed value indicating how many nested invocations of
#next
(if positive) or #previous
(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.
the distance as described above, or Long#MIN_VALUE
or
Long#MAX_VALUE
if the distance is too small or too large,
respectively.
Returns a Some
wiht the unique least value of type C
that is greater than
value
, or None
if none exists.
Returns a Some
wiht the unique least value of type C
that is greater than
value
, or None
if none exists. Inverse operation to
#previous
.
any value of type C
Some
with the least value greater than value
, or None
if
value
is maxValue()
Returns a Some
with the unique greatest value of type C
that is less than
value
, or None
if none exists.
Returns a Some
with the unique greatest value of type C
that is less than
value
, or None
if none exists. Inverse operation to
#next
.
any value of type C
Some
with the greatest value less than value
, or None
if
value
is minValue()
Returns a Some
with the maximum value of type C
, if it has one.
Returns a Some
with the maximum value of type C
, if it has one. The maximum
value is the unique value for which Ordering#compare(this,that)
never returns a negative value for any input of type C
.
The default implementation returns None
.
a Some
with the maximum value of type C
or None
if there is none
Returns a Some
with the minimum value of type C
, if it has one.
Returns a Some
with the minimum value of type C
, if it has one. The minimum
value is the unique value for which Ordering#compare(this,that)
never returns a positive value for any input of type C
.
The default implementation returns None
.
a Some
with the minimum value of type C
or None
if there is none
A descriptor for a discrete domain such as all
Int
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
.0.8 (copied from Guava-libraries)