public class SortInfo extends Object implements ISortInfo, Serializable
Implementation of table sort information bean.
Modifier and Type | Class and Description |
---|---|
class |
SortInfo.AscendingsContentProvider
Maps column keys to ascending values.
|
static class |
SortInfo.Ordinal |
class |
SortInfo.OrdinalsContentProvider
Maps column keys to ordinal values.
|
Modifier and Type | Field and Description |
---|---|
protected List |
m_ordinals |
Constructor and Description |
---|
SortInfo()
New, empty sort info constructor
|
SortInfo(ISortInfo sort)
Shallow copy of existing sort info.
|
SortInfo(String s)
Sort info from
toString() (with string keys). |
Modifier and Type | Method and Description |
---|---|
void |
add(int ordinal,
Object key,
boolean ascending)
Adds an ordinal.
|
void |
add(Object key,
boolean ascending)
Adds as last ordinal.
|
void |
clear()
Removes all ordinals.
|
boolean |
equals(Object o) |
void |
fromString(String s)
Reverses
toString() (with string keys). |
IContentProvider |
getAscendings()
Return content provider for mapping keys to ascending values.
|
Object |
getKey(int ordinal)
Sort key.
|
protected SortInfo.Ordinal |
getOrdinal(int ordinal) |
int |
getOrdinal(Object key)
Sort ordinal associated with specified key.
|
IContentProvider |
getOrdinals()
Return content provider for mapping keys to ordinal values.
|
int |
hashCode() |
boolean |
isAscending(int ordinal)
Sort order.
|
boolean |
isAscending(Object key)
Sort order associated with specified key.
|
void |
move(int fromOrdinal,
int toOrdinal)
Moves from first ordinal to second ordinal.
|
void |
remove(int ordinal)
Removes an ordinal.
|
int |
size()
Return number of sort keys.
|
void |
toggleAscending(int ordinal)
Toggles between ascending and descending for ordinal.
|
String |
toString() |
protected List m_ordinals
public SortInfo()
public SortInfo(String s)
toString()
(with string keys).public SortInfo(ISortInfo sort)
public int size()
ISortInfo
public Object getKey(int ordinal)
ISortInfo
getKey
in interface ISortInfo
ordinal
- Must be > 0 and <= ISortInfo.size()
.public boolean isAscending(int ordinal)
ISortInfo
isAscending
in interface ISortInfo
ordinal
- Must be > 0 and <= ISortInfo.size()
.public boolean isAscending(Object key)
ISortInfo
isAscending
in interface ISortInfo
key
- the sort key.public int getOrdinal(Object key)
ISortInfo
getOrdinal
in interface ISortInfo
key
- sort ordinalpublic IContentProvider getOrdinals()
ISortInfo
getOrdinals
in interface ISortInfo
SortInfo.OrdinalsContentProvider
public IContentProvider getAscendings()
ISortInfo
getAscendings
in interface ISortInfo
SortInfo.AscendingsContentProvider
public void toggleAscending(int ordinal)
public void add(Object key, boolean ascending)
key
- Non-null, non-empty key.ascending
- True if order is a-z, 1-10, Jan-Dec, etc.public void add(int ordinal, Object key, boolean ascending)
ordinal
- Must be > 0 and <= size()
.key
- Non-null, non-empty key.ascending
- True if order is a-z, 1-10, Jan-Dec, etc.IndexOutOfBoundsException
- If ordinal <= 1 or > size()
+ 1.public void remove(int ordinal)
ordinal
- Must be > 0 and <= size()
.IndexOutOfBoundsException
- If ordinal <= 1 or > size()
.public void move(int fromOrdinal, int toOrdinal)
fromOrdinal
- Must be > 0 and <= size()
.toOrdinal
- Must be > 0 and <= size()
.IndexOutOfBoundsException
- If either ordinal <= 1 or > size()
.public void clear()
public void fromString(String s)
toString()
(with string keys).protected SortInfo.Ordinal getOrdinal(int ordinal)
ordinal
- Must be > 0 and <= size()
.IndexOutOfBoundsException
- If ordinal <= 1 or > size()
.