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 TypeMethodDescriptionboolean
For 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 void
void
setSelection
(Integer selection) Sets the currently selected single value regardless of selection mode.void
protected void
Methods inherited from class com.simsilica.lemur.core.VersionedSet
createReference, getObject, getVersion, iterator, size
Methods inherited from class java.util.AbstractSet
equals, hashCode, removeAll
Methods inherited from class java.util.AbstractCollection
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
add
in interfaceCollection<Integer>
- Specified by:
add
in interfaceSet<Integer>
- Overrides:
add
in classVersionedSet<Integer>
-
incrementVersion
protected void incrementVersion()- Overrides:
incrementVersion
in classVersionedSet<Integer>
-
updateSelected
protected void updateSelected()
-