Package com.io7m.jranges
Class RangeHalfOpenB
java.lang.Object
com.io7m.jranges.RangeHalfOpenB
- All Implemented Interfaces:
RangeHalfOpenBType
A half open (inclusive lower, exclusive upper) range with
BigInteger components.- Since:
- 4.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RangeHalfOpenB.Builderbuilder()Creates a builder forRangeHalfOpenB.static RangeHalfOpenBcopyOf(RangeHalfOpenBType instance) Creates an immutable copy of aRangeHalfOpenBTypevalue.booleanThis instance is equal to all instances ofRangeHalfOpenBthat have equal attribute values.inthashCode()Computes a hash code from attributes:lower,upper.lower()static RangeHalfOpenBof(BigInteger lower, BigInteger upper) Construct a new immutableRangeHalfOpenBinstance.toString()Prints the immutable valueRangeHalfOpenBwith attribute values.upper()final RangeHalfOpenBwithLower(BigInteger value) Copy the current immutable object by setting a value for thelowerattribute.final RangeHalfOpenBwithUpper(BigInteger value) Copy the current immutable object by setting a value for theupperattribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.io7m.jranges.RangeHalfOpenBType
checkPreconditions, includesValue, interval, isIncludedIn, isIncludedIn
-
Method Details
-
lower
- Specified by:
lowerin interfaceRangeHalfOpenBType- Returns:
- The lower bound of the inclusive range.
-
upper
- Specified by:
upperin interfaceRangeHalfOpenBType- Returns:
- The upper bound of the inclusive range.
-
withLower
Copy the current immutable object by setting a value for thelowerattribute. 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
thisobject
-
withUpper
Copy the current immutable object by setting a value for theupperattribute. 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
thisobject
-
equals
This instance is equal to all instances ofRangeHalfOpenBthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:lower,upper. -
toString
Prints the immutable valueRangeHalfOpenBwith attribute values. -
of
Construct a new immutableRangeHalfOpenBinstance.- Parameters:
lower- The value for thelowerattributeupper- The value for theupperattribute- Returns:
- An immutable RangeHalfOpenB instance
-
copyOf
Creates an immutable copy of aRangeHalfOpenBTypevalue. 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 RangeHalfOpenB instance
-
builder
Creates a builder forRangeHalfOpenB.RangeHalfOpenB.builder() .setLower(java.math.BigInteger) // requiredlower.setUpper(java.math.BigInteger) // requiredupper.build();- Returns:
- A new RangeHalfOpenB builder
-