Package com.simsilica.lemur.list
Class SelectionModel
- All Implemented Interfaces:
VersionedObject<Set<Integer>>,Iterable<Integer>,Collection<Integer>,Set<Integer>
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanFor single-selections, this will hold the currently selected value.Returns the single selection if there is only one selected item or null if there is no selection or more than one item is selected.protected voidvoidsetSelection(Integer selection) Sets the currently selected single value regardless of selection mode.voidprotected voidMethods inherited from class com.simsilica.lemur.core.VersionedSet
createReference, getObject, getVersion, iterator, sizeMethods inherited from class java.util.AbstractSet
equals, hashCode, removeAllMethods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Constructor Details
-
SelectionModel
public SelectionModel()
-
-
Method Details
-
createSelectionReference
For single-selections, this will hold the currently selected value. -
setSelectionMode
-
getSelectionMode
-
getSelection
Returns the single selection if there is only one selected item or null if there is no selection or more than one item is selected. -
setSelection
Sets the currently selected single value regardless of selection mode. This clears the set before adding the selection. Also, if the specified selection is less than 0 then the selection is simply cleared. -
add
- Specified by:
addin interfaceCollection<Integer>- Specified by:
addin interfaceSet<Integer>- Overrides:
addin classVersionedSet<Integer>
-
incrementVersion
protected void incrementVersion()- Overrides:
incrementVersionin classVersionedSet<Integer>
-
updateSelected
protected void updateSelected()
-