Package com.iizix.prop.vs
Class VSTableRowSelection
java.lang.Object
com.iizix.prop.vs.VSTableRowSelection
Class holding the changed table row selection.
- Author:
- Christopher Mindus
Constructor Summary
ConstructorDescriptionVSTableRowSelection
(VSTable table, int index) Constructor for a single selection.VSTableRowSelection
(VSTable table, int[] indicies) Constructor for selection of indicies.Method Summary
Modifier and TypeMethodDescriptionboolean
Checks if two selections are equal.int
Gets the single selected row index.int[]
Gets the selected indicies.getTable()
Gets the table for the selection.boolean
Returns if the selection is a multiple selection, i.e.boolean
Returns if the selection event is a single selection event.boolean
Returns if the selection event is that all rows in the table are unselected.toString()
Returns the selection as a string as "NONE", "index", or "[index1, ..., indexN]".
Constructor Details
VSTableRowSelection
Constructor for selection of indicies.- Parameters:
table
- The table for the selection.indicies
- The selected indicies.
VSTableRowSelection
Constructor for a single selection.- Parameters:
table
- The table for the selection.index
- The selected row index, or -1 for no selection.
Method Details
isUnselected
public boolean isUnselected()Returns if the selection event is that all rows in the table are unselected.- Returns:
- true if all rows are unselected, false otherwise.
isSingleSelection
public boolean isSingleSelection()Returns if the selection event is a single selection event.- Returns:
- true if a single index is selected, false if no rows are selected or more than one index is selected.
isMultipleSelection
public boolean isMultipleSelection()Returns if the selection is a multiple selection, i.e. two or more rows are selected.- Returns:
- true if two or more rows are selected, false for one row selected or no row.
getSelectedIndex
public int getSelectedIndex()Gets the single selected row index.- Returns:
- The single selection row index, or -1 if none is selected or more than one is selected.
getSelectedIndicies
public int[] getSelectedIndicies()Gets the selected indicies.- Returns:
- The selected indicies. The length of the array is zero if no selection is present. It is one in length for single selections, otherwise the array contains the sorted selected row indicies (lowest to highest index).
getTable
Gets the table for the selection.- Returns:
- The VS table.
toString
Returns the selection as a string as "NONE", "index", or "[index1, ..., indexN]".equals
Checks if two selections are equal.