Interface ValueList<T>
- Type Parameters:
T- the value type
- All Superinterfaces:
Iterable<T>, Observable<List<T>>, ObservableValueCollection<T,List<T>>, Observer<List<T>>, Sensor, Value<List<T>>, ValueCollection<T, List<T>>
An observable wrapper for a List of values.
A factory for ValueList instances.
Thread-safe, as described in ValueCollection.
This list maintains item ordering and can be sorted via ValueCollection.sort(Comparator), which triggers
a change event since item ordering factors into List equality.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface Value
Value.BuilderFactory, Value.Locked, Value.Notify, Value.Validator<T> -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ValueList.Builder<T> builder()Creates a newValueList.Builderinstance.static <T> ValueList.Builder<T> builder(Collection<? extends T> values) Creates a newValueList.Builderinstance.Returns anObservableValueCollectionnotified each time this value changes.static <T> ValueList<T> Creates a new emptyValueList, usingValue.Notify.CHANGED.static <T> ValueList<T> valueList(Collection<? extends T> values) Creates a newValueList, usingValue.Notify.CHANGED.Methods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface Observable
changed, getOrThrow, getOrThrow, is, isNot, isNullMethods inherited from interface ObservableValueCollection
contains, containsAll, containsNone, containsOnly, isEmpty, sizeMethods inherited from interface Observer
addConsumer, addWeakConsumer, observer, removeConsumer, removeWeakConsumer, sensor, when, whenMethods inherited from interface Sensor
addListener, addWeakListener, removeListener, removeWeakListener
-
Method Details
-
observable
ObservableValueList<T> observable()Description copied from interface:ValueCollectionReturns anObservableValueCollectionnotified each time this value changes.- Specified by:
observablein interfaceValue<T>- Specified by:
observablein interfaceValueCollection<T,List<T>> - Returns:
- an
ObservableValueCollectionfor this value
-
valueList
Creates a new emptyValueList, usingValue.Notify.CHANGED.- Type Parameters:
T- the value type- Returns:
- a new
ValueList
-
valueList
Creates a newValueList, usingValue.Notify.CHANGED.- Type Parameters:
T- the value type- Parameters:
values- the initial values, may not be null- Returns:
- a new
ValueList - Throws:
NullPointerException- in casevaluesis null
-
builder
Creates a newValueList.Builderinstance.- Type Parameters:
T- the value set type- Returns:
- a new builder
-
builder
Creates a newValueList.Builderinstance.- Type Parameters:
T- the value set type- Parameters:
values- the initial values, may not be null- Returns:
- a new builder
- Throws:
NullPointerException- in casevaluesis null
-