Package snap.util
Class ListSel
java.lang.Object
snap.util.ListSel
- All Implemented Interfaces:
Cloneable
Represents a selection for a List.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected ListSel
clone()
Standard clone implementation.copyForMaxSize
(int aSize) Returns a ListSel with anything above max trimmed.copyForMetaAdd
(int anch, int lead) Returns a copy of this ListSel resulting from 'Meta-adding' new selection (short-cut key is down).copyForShiftAdd
(int anch, int lead) Returns a copy of this ListSel resulting from 'Shift-adding' new selection (shift key is down).Returns a ListSel guaranteed to have no more than one selection.boolean
Standard equals implementation.int
Returns the anchor.static int[]
getChangedIndexes
(ListSel aSel1, ListSel aSel2) Returns the changed indexes for two ListSels.int[]
Returns the selected indexes.int
getLead()
Returns the lead.int
getMax()
Return the max.int
getMin()
Return the min.Returns the selection encompassing all.static ListSel
getSelForIndexArray
(int[] theIndexes) Returns a ListSel for array of indexes.getTail()
Returns the tail selection.int
hashCode()
Standard hashCode implementation.boolean
isEmpty()
Returns whether the selection is empty.boolean
isSel
(int anIndex) Returns whether given index is selected.toString()
Standard toString implementation.
-
Field Details
-
EMPTY
-
-
Constructor Details
-
ListSel
public ListSel(int anch, int lead) Constructor.
-
-
Method Details
-
isEmpty
public boolean isEmpty()Returns whether the selection is empty. -
isSel
public boolean isSel(int anIndex) Returns whether given index is selected. -
getAnchor
public int getAnchor()Returns the anchor. -
getLead
public int getLead()Returns the lead. -
getMin
public int getMin()Return the min. -
getMax
public int getMax()Return the max. -
getSelAll
Returns the selection encompassing all. -
getTail
Returns the tail selection. -
getIndexes
public int[] getIndexes()Returns the selected indexes. -
copyForSingleSel
Returns a ListSel guaranteed to have no more than one selection. -
copyForShiftAdd
Returns a copy of this ListSel resulting from 'Shift-adding' new selection (shift key is down). -
copyForMetaAdd
Returns a copy of this ListSel resulting from 'Meta-adding' new selection (short-cut key is down). -
copyForMaxSize
Returns a ListSel with anything above max trimmed. -
clone
Standard clone implementation. -
hashCode
public int hashCode()Standard hashCode implementation. -
equals
Standard equals implementation. -
toString
Standard toString implementation. -
getSelForIndexArray
Returns a ListSel for array of indexes. -
getChangedIndexes
Returns the changed indexes for two ListSels.
-