Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.table
Class SortState

java.lang.Object
  extended by com.citra.table.SortState
All Implemented Interfaces:
Serializable

public class SortState
extends Object
implements Serializable

SortState is a class that holds information about the sorting state of a table column. This class is used by SortTableModel to keep track of sorting.

See Also:
Serialized Form

Constructor Summary
SortState(int field)
          Constructs a SortState with field indicating the view index of the table column that we want to sort.
SortState(int field, boolean ascending)
          Constructs a SortState with field indicating the view index of the table column that we want to sort.
 
Method Summary
 void flip()
          Flips the sorting order of the SortState.
 int getField()
          Returns the field that corresponds to the view index of the table column.
 boolean isAscending()
          Returns true if the sorting is in ascending order.
 String toString()
          Returns a string representation of the sort state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SortState

public SortState(int field)
Constructs a SortState with field indicating the view index of the table column that we want to sort. The sorting is in ascending order.


SortState

public SortState(int field,
                 boolean ascending)
Constructs a SortState with field indicating the view index of the table column that we want to sort. The sorting is in ascending order if ascending is true.

Method Detail

flip

public void flip()
Flips the sorting order of the SortState.


getField

public int getField()
Returns the field that corresponds to the view index of the table column.

Returns:
the view index of the sorted table column.

isAscending

public boolean isAscending()
Returns true if the sorting is in ascending order.

Returns:
true if the sorting is in ascending order, false otherwise.

toString

public String toString()
Returns a string representation of the sort state.

Overrides:
toString in class Object
Returns:
a string representation of the sort state.

Copyright © 2011 Citra Technologies. All Rights Reserved.