RangeInclusiveITypepublic final class RangeInclusiveI extends Object implements RangeInclusiveIType
int components.| Modifier and Type | Class | Description |
|---|---|---|
static class |
RangeInclusiveI.Builder |
Builds instances of type
RangeInclusiveI. |
| Modifier and Type | Method | Description |
|---|---|---|
static RangeInclusiveI.Builder |
builder() |
Creates a builder for
RangeInclusiveI. |
static RangeInclusiveI |
copyOf(RangeInclusiveIType instance) |
Creates an immutable copy of a
RangeInclusiveIType value. |
boolean |
equals(Object another) |
This instance is equal to all instances of
RangeInclusiveI that have equal attribute values. |
int |
hashCode() |
Computes a hash code from attributes:
lower, upper, interval. |
int |
interval() |
Retrieve the number of values in the range
[lower, upper]. |
int |
lower() |
|
static RangeInclusiveI |
of(int lower,
int upper) |
Construct a new immutable
RangeInclusiveI instance. |
String |
toString() |
Prints the immutable value
RangeInclusiveI with attribute values. |
int |
upper() |
|
RangeInclusiveI |
withLower(int value) |
Copy the current immutable object by setting a value for the
lower attribute. |
RangeInclusiveI |
withUpper(int value) |
Copy the current immutable object by setting a value for the
upper attribute. |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitcheckPreconditions, includesValue, isIncludedInpublic int lower()
lower in interface RangeInclusiveITypepublic int upper()
upper in interface RangeInclusiveITypepublic int interval()
Retrieve the number of values in the range [lower, upper]. That
is, (upper - lower) + 1.
interval in interface RangeInclusiveITypepublic final RangeInclusiveI withLower(int value)
lower attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for lowerthis objectpublic final RangeInclusiveI withUpper(int value)
upper attribute.
A value equality check is used to prevent copying of the same value by returning this.value - A new value for upperthis objectpublic boolean equals(Object another)
RangeInclusiveI that have equal attribute values.public int hashCode()
lower, upper, interval.public String toString()
RangeInclusiveI with attribute values.public static RangeInclusiveI of(int lower, int upper)
RangeInclusiveI instance.lower - The value for the lower attributeupper - The value for the upper attributepublic static RangeInclusiveI copyOf(RangeInclusiveIType instance)
RangeInclusiveIType value.
Uses accessors to get values to initialize the new immutable instance.
If an instance is already immutable, it is returned as is.instance - The instance to copypublic static RangeInclusiveI.Builder builder()
RangeInclusiveI.Copyright © 2017 <code@io7m.com> http://io7m.com