| Modifier and Type | Class and Description |
|---|---|
| public static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final Range | ANY
A range between 0 and infinity. |
| public static final Range | AT_LEAST_ONE
A range between 1 and infinity. |
| private final int | |
| private final boolean | isInfinite
Whether the range is infinite. |
| public static final Range | NONE
A range of 0. |
| public static final Range | NONE_OR_ONE
A range between 0 and 1. |
| public static final Range | ONE
A range of 1. |
| private final int |
| Access | Constructor and Description |
|---|---|
| private | Range(int
The start value start, int The end value, or -1 for infinity end)Creates a new range with the given start and end values. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the value is in the rangeThe value to check value, boolean Whether the start value is inclusive startInclusive, boolean Whether the end value is inclusive endInclusive)Returns |
| public boolean | Returns: true if the value is in the rangeThe value to check value)Returns |
| public boolean | Returns: true if the value is in the rangeThe value to check value)Returns |
| public int | |
| public static @NotNull Range. | |
| public @NotNull String | Returns: The string representationThe kind of thing the range is for, such as "time" or "argument" kind)Returns a string representation of the range, such as "from 3 to 5 times", or "3 times". |
| public @NotNull String | Returns: The string representationReturns a string representation of the range, such as |
| public boolean | |
| public boolean | |
| public boolean | |
| public @NotNull Iterator | Returns: The iteratorImplements java. Returns an iterator that iterates over the range. |
| public @NotNull Iterator | Returns: The iteratorWhether the start value is inclusive startInclusive, boolean Whether the end value is inclusive endInclusive)Returns an iterator that iterates over the range. |
| public static @NotNull Range | |
| public @NotNull Range | Returns: The new rangeThe offset to apply offset)Offsets both the start and end values by the given offset. |
| public int | |
| public int[] | |
| public int[] | Returns: The arrayWhether the start value is inclusive startInclusive, boolean Whether the end value is inclusive endInclusive)Returns an array of all the values in the range. |
| public String |
| ANY | back to summary |
|---|---|
| public static final Range ANY A range between 0 and infinity. | |
| AT_LEAST_ONE | back to summary |
|---|---|
| public static final Range AT_LEAST_ONE A range between 1 and infinity. | |
| end | back to summary |
|---|---|
| private final int end | |
| isInfinite | back to summary |
|---|---|
| private final boolean isInfinite Whether the range is infinite. | |
| NONE | back to summary |
|---|---|
| public static final Range NONE A range of 0. | |
| NONE_OR_ONE | back to summary |
|---|---|
| public static final Range NONE_OR_ONE A range between 0 and 1. | |
| ONE | back to summary |
|---|---|
| public static final Range ONE A range of 1. | |
| start | back to summary |
|---|---|
| private final int start | |
| Range | back to summary |
|---|---|
| private Range(int start, int end) Creates a new range with the given start and end values. If the end value is -1, the range end value will be infinity.
| |
| contains | back to summary |
|---|---|
| public boolean contains(int value, boolean startInclusive, boolean endInclusive) Returns
| |
| containsExclusive | back to summary |
|---|---|
| public boolean containsExclusive(int value) Returns
| |
| containsInclusive | back to summary |
|---|---|
| public boolean containsInclusive(int value) Returns
| |
| end | back to summary |
|---|---|
| public int end() Returns the end value, or | |
| from | back to summary |
|---|---|
| public static @NotNull Range. Creates a new range builder with the given start value.
| |
| getMessage | back to summary |
|---|---|
| public @NotNull String getMessage(@NotNull String kind) Returns a string representation of the range, such as "from 3 to 5 times", or "3 times". | |
| getRepresentation | back to summary |
|---|---|
| public @NotNull String getRepresentation() Returns a string representation of the range, such as | |
| isInfinite | back to summary |
|---|---|
| public boolean isInfinite() Returns | |
| isSimple | back to summary |
|---|---|
| public boolean isSimple() Returns | |
| isZero | back to summary |
|---|---|
| public boolean isZero() Returns | |
| iterator | back to summary |
|---|---|
| public @NotNull Iterator Implements java. Returns an iterator that iterates over the range. Both the start and end values are inclusive. | |
| iterator | back to summary |
|---|---|
| public @NotNull Iterator Returns an iterator that iterates over the range. | |
| of | back to summary |
|---|---|
| public static @NotNull Range of(int value) Creates a new single-value range with the given value.
| |
| offset | back to summary |
|---|---|
| public @NotNull Range offset(int offset) Offsets both the start and end values by the given offset. The range will be infinite if it was infinite before. | |
| start | back to summary |
|---|---|
| public int start() Returns the start value. | |
| toArray | back to summary |
|---|---|
| public int[] toArray() Returns an array of all the values in the range, inclusive.
If the range is infinite, an
| |
| toArray | back to summary |
|---|---|
| public int[] toArray(boolean startInclusive, boolean endInclusive) Returns an array of all the values in the range.
If the range is infinite, an
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| private @NotNull Range | |
| public @NotNull Range | |
| public @NotNull Range |
| RangeBuilder | back to summary |
|---|---|
| private RangeBuilder(int start) | |
| build | back to summary |
|---|---|
| private @NotNull Range build() Builds the range.
| |
| to | back to summary |
|---|---|
| public @NotNull Range to(int end) Sets the end value.
| |
| toInfinity | back to summary |
|---|---|
| public @NotNull Range toInfinity() Sets the end value to infinity.
| |