Class ColumnSortList
- java.lang.Object
-
- com.google.gwt.user.cellview.client.ColumnSortList
-
public class ColumnSortList extends java.lang.ObjectAn ordered list containing the sort history ofColumns in a table. The 0th item is theColumnSortList.ColumnSortInfoof the most recently sorted column.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classColumnSortList.ColumnSortInfoInformation about the sort order of a specific column in a table.static interfaceColumnSortList.DelegateThe delegate that handles modifications to the list.
-
Constructor Summary
Constructors Constructor Description ColumnSortList()Construct a newColumnSortListwithout aColumnSortList.Delegate.ColumnSortList(ColumnSortList.Delegate delegate)Construct a newColumnSortListwith the specifiedColumnSortList.Delegate.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Removes all of the elements from this list.booleanequals(java.lang.Object obj)Check if the specified object equals this list.ColumnSortList.ColumnSortInfoget(int index)Get theColumnSortList.ColumnSortInfoat the specified index.intgetLimit()Get the actual limit valueinthashCode()voidinsert(int index, ColumnSortList.ColumnSortInfo sortInfo)Inserts the specifiedColumnSortList.ColumnSortInfoat the specified position in this list.ColumnSortList.ColumnSortInfopush(Column<?,?> column)Push aColumnonto the list at index zero, setting ascending to true.voidpush(ColumnSortList.ColumnSortInfo sortInfo)Push aColumnSortList.ColumnSortInfoonto the list at index zero.booleanremove(ColumnSortList.ColumnSortInfo sortInfo)Remove aColumnSortList.ColumnSortInfofrom the list.voidsetLimit(int limit)Set the limit to a positive value to prevent the growth of the infos list over the given size.intsize()Get the size of the list.
-
-
-
Constructor Detail
-
ColumnSortList
public ColumnSortList()
Construct a newColumnSortListwithout aColumnSortList.Delegate.
-
ColumnSortList
public ColumnSortList(ColumnSortList.Delegate delegate)
Construct a newColumnSortListwith the specifiedColumnSortList.Delegate.- Parameters:
delegate- theColumnSortList.Delegateto inform of modifications
-
-
Method Detail
-
clear
public void clear()
Removes all of the elements from this list.
-
equals
public boolean equals(java.lang.Object obj)
Check if the specified object equals this list. TwoColumnSortListare equals if they are the same size, and all entries areequalsand in the same order.- Overrides:
equalsin classjava.lang.Object
-
get
public ColumnSortList.ColumnSortInfo get(int index)
Get theColumnSortList.ColumnSortInfoat 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()
- Overrides:
hashCodein classjava.lang.Object
-
insert
public void insert(int index, ColumnSortList.ColumnSortInfo sortInfo)Inserts the specifiedColumnSortList.ColumnSortInfoat 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.ColumnSortInfoto add
-
push
public ColumnSortList.ColumnSortInfo push(Column<?,?> column)
Push aColumnonto 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- theColumnto push- Returns:
- the
ColumnSortList.ColumnSortInfothat was pushed
-
push
public void push(ColumnSortList.ColumnSortInfo sortInfo)
Push aColumnSortList.ColumnSortInfoonto 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.ColumnSortInfoto push
-
remove
public boolean remove(ColumnSortList.ColumnSortInfo sortInfo)
Remove aColumnSortList.ColumnSortInfofrom the list.- Parameters:
sortInfo- theColumnSortList.ColumnSortInfoto 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.ColumnSortInfoin the list
-
-