RangeList
abstract class RangeList<E>
Extends: AbstractList<E>
Implements: RandomAccess
Package: dev.joid.internal · Module: core · Source: RangeList.java
Read-only list of the options of a slider range, whose values are computed from their index instead of stored.
Description
Section titled “Description”IntegerSliderNode and DoubleSliderNode hold their range in one, so a range of millions of values costs nothing; getValueList() returns it.
contains and indexOf compute the index of a value instead of walking the list.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
| RangeList() | Creates the list, for a subclass that gives get(int), size(), indexOf(Object) and nearest(E). |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
int | lastIndexOf(Object value) | Returns the index of value, the same as indexOf, since an option appears once. |
boolean | contains(Object value) | If true, value is one of the options; it calls indexOf. |
String | toString() | Returns the options in brackets, shortened to the first two and the last one past ten options: [1, 2, ..., 2147483647]. |
For subclasses
Section titled “For subclasses”| Returns | Signature | Summary |
|---|---|---|
E | nearest(E value) hook abstract | Returns the option nearest to value, the smaller one on a tie. |
Creation details
Section titled “Creation details”RangeList
Section titled “RangeList”RangeList()
Creates the list, for a subclass that gives get(int), size(), indexOf(Object) and nearest(E).
Method details
Section titled “Method details”lastIndexOf
Section titled “lastIndexOf”int lastIndexOf(Object value)
Returns the index of value, the same as indexOf, since an option appears once.
contains
Section titled “contains”boolean contains(Object value)
If true, value is one of the options; it calls indexOf.
toString
Section titled “toString”String toString()
Returns the options in brackets, shortened to the first two and the last one past ten options: [1, 2, ..., 2147483647].
nearest
Section titled “nearest”E nearest(E value) hook abstract
Returns the option nearest to value, the smaller one on a tie.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
