Class TableSortState

  • All Implemented Interfaces:
    java.lang.Iterable<ColumnSortState>

    public class TableSortState
    extends java.lang.Object
    implements java.lang.Iterable<ColumnSortState>
    Represents the concept of a table's sorted state, which is the number of sorted columns, their sort order and their sort direction. You can create instances of this class via the TableSortStateEditor.
    • Constructor Detail

      • TableSortState

        public TableSortState()
      • TableSortState

        public TableSortState​(java.util.List<ColumnSortState> sortStates)
      • TableSortState

        public TableSortState​(ColumnSortState columnSortState)
    • Method Detail

      • createUnsortedSortState

        public static TableSortState createUnsortedSortState()
        Creates a sort state that represents being unsorted
        Returns:
        a sort state that represents being unsorted
      • createDefaultSortState

        public static TableSortState createDefaultSortState​(int columnIndex)
        Creates a sort state with the given column as the sorted column (sorted ascending).
        Parameters:
        columnIndex - The column to sort
        Returns:
        a sort state with the given column as the sorted column (sorted ascending).
        See Also:
        TableSortStateEditor
      • createDefaultSortState

        public static TableSortState createDefaultSortState​(int columnIndex,
                                                            boolean isAscending)
        Creates a sort state with the given column as the sorted column in the given direction.
        Parameters:
        columnIndex - The column to sort
        isAscending - True to sort ascending; false to sort descending
        Returns:
        a sort state with the given column as the sorted column (sorted ascending).
        See Also:
        TableSortStateEditor
      • getSortedColumnCount

        public int getSortedColumnCount()
      • isUnsorted

        public boolean isUnsorted()
      • getColumnSortState

        public ColumnSortState getColumnSortState​(int columnIndex)
      • getAllSortStates

        public java.util.List<ColumnSortState> getAllSortStates()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • restoreFromXML

        public static TableSortState restoreFromXML​(org.jdom.Element element)
      • writeToXML

        public org.jdom.Element writeToXML()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object