Package com.io7m.jranges
Class RangeInclusiveB
java.lang.Object
com.io7m.jranges.RangeInclusiveB
- All Implemented Interfaces:
RangeInclusiveBType
An inclusive range with
BigInteger
components.-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic RangeInclusiveB.Builder
builder()
Creates a builder forRangeInclusiveB
.static RangeInclusiveB
copyOf
(RangeInclusiveBType instance) Creates an immutable copy of aRangeInclusiveBType
value.boolean
This instance is equal to all instances ofRangeInclusiveB
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:lower
,upper
.lower()
static RangeInclusiveB
of
(BigInteger lower, BigInteger upper) Construct a new immutableRangeInclusiveB
instance.toString()
Prints the immutable valueRangeInclusiveB
with attribute values.upper()
final RangeInclusiveB
withLower
(BigInteger value) Copy the current immutable object by setting a value for thelower
attribute.final RangeInclusiveB
withUpper
(BigInteger value) Copy the current immutable object by setting a value for theupper
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.io7m.jranges.RangeInclusiveBType
checkPreconditions, includesValue, interval, isIncludedIn
-
Method Details
-
lower
- Specified by:
lower
in interfaceRangeInclusiveBType
- Returns:
- The lower bound of the inclusive range.
-
upper
- Specified by:
upper
in interfaceRangeInclusiveBType
- Returns:
- The upper bound of the inclusive range.
-
withLower
Copy the current immutable object by setting a value for thelower
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for lower- Returns:
- A modified copy of the
this
object
-
withUpper
Copy the current immutable object by setting a value for theupper
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for upper- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofRangeInclusiveB
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:lower
,upper
. -
toString
Prints the immutable valueRangeInclusiveB
with attribute values. -
of
Construct a new immutableRangeInclusiveB
instance.- Parameters:
lower
- The value for thelower
attributeupper
- The value for theupper
attribute- Returns:
- An immutable RangeInclusiveB instance
-
copyOf
Creates an immutable copy of aRangeInclusiveBType
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable RangeInclusiveB instance
-
builder
Creates a builder forRangeInclusiveB
.RangeInclusiveB.builder() .setLower(java.math.BigInteger) // required
lower
.setUpper(java.math.BigInteger) // requiredupper
.build();- Returns:
- A new RangeInclusiveB builder
-