Package com.yahoo.config.provision
Class IntRange
java.lang.Object
com.yahoo.config.provision.IntRange
An integer range.
- Author:
- bratseth
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic IntRange
empty()
boolean
int
fit
(int value) Returns the given value adjusted minimally to fit within this range.from()
Returns the minimum value which is in this range, or empty if it is open downwards.static IntRange
from
(int from) static IntRange
Parses a value ("value"), value range ("[min-value?, max-value?]"), or empty.fromAtMost
(int minLimit) Returns this with a 'from' limit which is at most the given valueint
hashCode()
boolean
includes
(int value) Returns whether the given value is in this range.boolean
isEmpty()
Returns true if both from and to is open (not present).static IntRange
of
(int fromTo) static IntRange
of
(int from, int to) to()
Returns the maximum value which is in this range, or empty if it is open upwards.static IntRange
to
(int to) toAtLeast
(int maxLimit) Returns this with a 'to' limit which is at least the given valuetoString()
-
Constructor Details
-
IntRange
-
-
Method Details
-
from
Returns the minimum value which is in this range, or empty if it is open downwards. -
to
Returns the maximum value which is in this range, or empty if it is open upwards. -
isEmpty
public boolean isEmpty()Returns true if both from and to is open (not present). -
includes
public boolean includes(int value) Returns whether the given value is in this range. -
fit
public int fit(int value) Returns the given value adjusted minimally to fit within this range. -
equals
-
hashCode
public int hashCode() -
toString
-
empty
-
from
-
to
-
of
-
of
-
fromAtMost
Returns this with a 'from' limit which is at most the given value -
toAtLeast
Returns this with a 'to' limit which is at least the given value -
from
Parses a value ("value"), value range ("[min-value?, max-value?]"), or empty.
-