Package com.io7m.jranges
Class RangeHalfOpenD
java.lang.Object
com.io7m.jranges.RangeHalfOpenD
- All Implemented Interfaces:
RangeHalfOpenDType
A half open (inclusive lower, exclusive upper) range with
double components.- Since:
- 4.0.0
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic RangeHalfOpenD.Builderbuilder()Creates a builder forRangeHalfOpenD.static RangeHalfOpenDcopyOf(RangeHalfOpenDType instance) Creates an immutable copy of aRangeHalfOpenDTypevalue.booleanThis instance is equal to all instances ofRangeHalfOpenDthat have equal attribute values.inthashCode()Computes a hash code from attributes:lower,upper.doublelower()static RangeHalfOpenDof(double lower, double upper) Construct a new immutableRangeHalfOpenDinstance.toString()Prints the immutable valueRangeHalfOpenDwith attribute values.doubleupper()final RangeHalfOpenDwithLower(double value) Copy the current immutable object by setting a value for thelowerattribute.final RangeHalfOpenDwithUpper(double 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.RangeHalfOpenDType
checkPreconditions, includesValue, interval, isIncludedIn, isIncludedIn
-
Method Details
-
lower
public double lower()- Specified by:
lowerin interfaceRangeHalfOpenDType- Returns:
- The lower bound of the inclusive range.
-
upper
public double upper()- Specified by:
upperin interfaceRangeHalfOpenDType- Returns:
- The upper bound of the inclusive range.
-
withLower
Copy the current immutable object by setting a value for thelowerattribute. A value strict bits equality 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. A value strict bits equality 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 ofRangeHalfOpenDthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:lower,upper. -
toString
Prints the immutable valueRangeHalfOpenDwith attribute values. -
of
Construct a new immutableRangeHalfOpenDinstance.- Parameters:
lower- The value for thelowerattributeupper- The value for theupperattribute- Returns:
- An immutable RangeHalfOpenD instance
-
copyOf
Creates an immutable copy of aRangeHalfOpenDTypevalue. 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 RangeHalfOpenD instance
-
builder
Creates a builder forRangeHalfOpenD.RangeHalfOpenD.builder() .setLower(double) // requiredlower.setUpper(double) // requiredupper.build();- Returns:
- A new RangeHalfOpenD builder
-