Class VSTableRowSelection

java.lang.Object
com.iizix.prop.vs.VSTableRowSelection

public final class VSTableRowSelection extends Object
Class holding the changed table row selection.
Author:
Christopher Mindus
  • Constructor Details

    • VSTableRowSelection

      public VSTableRowSelection(VSTable table, int[] indicies)
      Constructor for selection of indicies.
      Parameters:
      table - The table for the selection.
      indicies - The selected indicies.
    • VSTableRowSelection

      public VSTableRowSelection(VSTable table, int index)
      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

      public VSTable getTable()
      Gets the table for the selection.
      Returns:
      The VS table.
    • toString

      public String toString()
      Returns the selection as a string as "NONE", "index", or "[index1, ..., indexN]".
      Overrides:
      toString in class Object
      Returns:
      The selection string for e.g. debug purposes.
    • equals

      public boolean equals(Object o)
      Checks if two selections are equal.
      Overrides:
      equals in class Object
      Parameters:
      o - The Object to check equality with.
      Returns:
      true if the Object o is the same selection, false if not the same selection or the object is not an instance of this class.