Class SortInfo
java.lang.Object
com.webmethods.caf.faces.data.object.SortInfo
- All Implemented Interfaces:
ISortInfo
,Serializable
Implementation of table sort information bean.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Maps column keys to ascending values.static class
class
Maps column keys to ordinal values. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds an ordinal.void
Adds as last ordinal.void
clear()
Removes all ordinals.boolean
void
fromString
(String s) ReversestoString()
(with string keys).Return content provider for mapping keys to ascending values.getKey
(int ordinal) Sort key.protected SortInfo.Ordinal
getOrdinal
(int ordinal) int
getOrdinal
(Object key) Sort ordinal associated with specified key.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.toString()
-
Field Details
-
m_ordinals
-
-
Constructor Details
-
SortInfo
public SortInfo()New, empty sort info constructor -
SortInfo
Sort info fromtoString()
(with string keys). -
SortInfo
Shallow copy of existing sort info.
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
size
public int size()Description copied from interface:ISortInfo
Return number of sort keys. May be zero. -
getKey
Description copied from interface:ISortInfo
Sort key. The 1st key is the primary key, the 2nd key is the secondary key, etc.- Specified by:
getKey
in interfaceISortInfo
- Parameters:
ordinal
- Must be > 0 and <=ISortInfo.size()
.- Returns:
- Non-null, non-empty key.
-
isAscending
public boolean isAscending(int ordinal) Description copied from interface:ISortInfo
Sort order. The 1st order is the primary order, the 2nd order is the secondary order, etc.- Specified by:
isAscending
in interfaceISortInfo
- Parameters:
ordinal
- Must be > 0 and <=ISortInfo.size()
.- Returns:
- True if order is a-z, 1-10, Jan-Dec, etc.
-
isAscending
Description copied from interface:ISortInfo
Sort order associated with specified key.- Specified by:
isAscending
in interfaceISortInfo
- Parameters:
key
- the sort key.- Returns:
- True if order is a-z, 1-10, Jan-Dec, etc., or if key is not present.
-
getOrdinal
Description copied from interface:ISortInfo
Sort ordinal associated with specified key.- Specified by:
getOrdinal
in interfaceISortInfo
- Parameters:
key
- sort ordinal- Returns:
- Ordinal, or zero if key is not present.
-
getOrdinals
Description copied from interface:ISortInfo
Return content provider for mapping keys to ordinal values.- Specified by:
getOrdinals
in interfaceISortInfo
- Returns:
- instance of
SortInfo.OrdinalsContentProvider
-
getAscendings
Description copied from interface:ISortInfo
Return content provider for mapping keys to ascending values.- Specified by:
getAscendings
in interfaceISortInfo
- Returns:
- instance of
SortInfo.AscendingsContentProvider
-
toggleAscending
public void toggleAscending(int ordinal) Toggles between ascending and descending for ordinal. -
add
Adds as last ordinal.- Parameters:
key
- Non-null, non-empty key.ascending
- True if order is a-z, 1-10, Jan-Dec, etc.
-
add
Adds an ordinal. The 1st key is the primary key, the 2nd key is the secondary key, etc.- Parameters:
ordinal
- Must be > 0 and <=size()
.key
- Non-null, non-empty key.ascending
- True if order is a-z, 1-10, Jan-Dec, etc.- Throws:
IndexOutOfBoundsException
- If ordinal <= 1 or >size()
+ 1.
-
remove
public void remove(int ordinal) Removes an ordinal. The 1st key is the primary key, the 2nd key is the secondary key, etc.- Parameters:
ordinal
- Must be > 0 and <=size()
.- Throws:
IndexOutOfBoundsException
- If ordinal <= 1 or >size()
.
-
move
public void move(int fromOrdinal, int toOrdinal) Moves from first ordinal to second ordinal.- Parameters:
fromOrdinal
- Must be > 0 and <=size()
.toOrdinal
- Must be > 0 and <=size()
.- Throws:
IndexOutOfBoundsException
- If either ordinal <= 1 or >size()
.
-
clear
public void clear()Removes all ordinals. -
fromString
ReversestoString()
(with string keys). -
getOrdinal
- Parameters:
ordinal
- Must be > 0 and <=size()
.- Returns:
- Ordinal object.
- Throws:
IndexOutOfBoundsException
- If ordinal <= 1 or >size()
.
-