Class ColumnSortList
java.lang.Object
com.google.gwt.user.cellview.client.ColumnSortList
An ordered list containing the sort history of
Column
s in a table.
The 0th item is the ColumnSortList.ColumnSortInfo
of the most recently sorted
column.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Information about the sort order of a specific column in a table.static interface
The delegate that handles modifications to the list. -
Constructor Summary
ConstructorDescriptionConstruct a newColumnSortList
without aColumnSortList.Delegate
.ColumnSortList
(ColumnSortList.Delegate delegate) Construct a newColumnSortList
with the specifiedColumnSortList.Delegate
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all of the elements from this list.boolean
Check if the specified object equals this list.get
(int index) Get theColumnSortList.ColumnSortInfo
at the specified index.int
getLimit()
Get the actual limit valueint
hashCode()
void
insert
(int index, ColumnSortList.ColumnSortInfo sortInfo) Inserts the specifiedColumnSortList.ColumnSortInfo
at the specified position in this list.Push aColumn
onto the list at index zero, setting ascending to true.void
push
(ColumnSortList.ColumnSortInfo sortInfo) Push aColumnSortList.ColumnSortInfo
onto the list at index zero.boolean
remove
(ColumnSortList.ColumnSortInfo sortInfo) Remove aColumnSortList.ColumnSortInfo
from the list.void
setLimit
(int limit) Set the limit to a positive value to prevent the growth of the infos list over the given size.int
size()
Get the size of the list.
-
Constructor Details
-
ColumnSortList
public ColumnSortList()Construct a newColumnSortList
without aColumnSortList.Delegate
. -
ColumnSortList
Construct a newColumnSortList
with the specifiedColumnSortList.Delegate
.- Parameters:
delegate
- theColumnSortList.Delegate
to inform of modifications
-
-
Method Details
-
clear
public void clear()Removes all of the elements from this list. -
equals
Check if the specified object equals this list. TwoColumnSortList
are equals if they are the same size, and all entries areequals
and in the same order. -
get
Get theColumnSortList.ColumnSortInfo
at the specified index.- Parameters:
index
- the index- Returns:
- the
ColumnSortList.ColumnSortInfo
-
getLimit
public int getLimit()Get the actual limit value- Returns:
- the actual limit value
-
hashCode
public int hashCode() -
insert
Inserts the specifiedColumnSortList.ColumnSortInfo
at the specified position in this list. If the column already exists in the sort info, the index will be adjusted to account for any removed entries.- Parameters:
sortInfo
- theColumnSortList.ColumnSortInfo
to add
-
push
Push aColumn
onto the list at index zero, setting ascending to true. If the column already exists, it will be removed from its current position and placed at the start of the list. If the Column is already at the start of the list, its ascending bit will be flipped (ascending to descending and vice versa).- Parameters:
column
- theColumn
to push- Returns:
- the
ColumnSortList.ColumnSortInfo
that was pushed
-
push
Push aColumnSortList.ColumnSortInfo
onto the list at index zero. If the column already exists, it will be removed from its current position and placed at the start of the list.- Parameters:
sortInfo
- theColumnSortList.ColumnSortInfo
to push
-
remove
Remove aColumnSortList.ColumnSortInfo
from the list.- Parameters:
sortInfo
- theColumnSortList.ColumnSortInfo
to remove
-
setLimit
public void setLimit(int limit) Set the limit to a positive value to prevent the growth of the infos list over the given size. This method will check if the actual infos list is over the limit, and it will fire the delegate in the case it should remove items from the list. The default value (0) means the size can grow indefinitely.- Parameters:
limit
- the new limit value
-
size
public int size()Get the size of the list.- Returns:
- the number of
ColumnSortList.ColumnSortInfo
in the list
-