|
Sydney | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--ViewerSorter
Defined in viewer_sorter.js
Constructor Summary | |
ViewerSorter
(comparator)
|
Method Summary | |
int
|
getIndexOf(<Object> newChild, <ArrayList> existingChildren)
Calculates the insertion point of a new object given a list of existing objects. |
void
|
invert()
Inverts the current sort order. |
boolean
|
isInverted()
Returns true if the current sort order is the same as
when the sorter was constructed, and false if the current
sort order is inverted as compared to construct-time sort order.
|
void
|
setInverted(<boolean> inverted)
Sets the inverted state to inverted .
|
void
|
sort(<ArrayList> children)
Sorts the given list of objects in place. |
<static> function
|
NUM_COMP(<number> numA, <number> numB)
A comparator for numbers (either int s or float s),
suitable for passing to a ViewerSorter .
|
<static> int
|
STR_COMP(<string> strA, <string> strB)
A comparator for string s, suitable for passing to a
ViewerSorter .
|
<static> Function
|
getChainedComparator()
Returns a comparator suitable for passing to a ViewerSorter
that compares two values based on a sequence of prioritized keys.
|
<static> Function
|
getCompositeComparator(<string> path, <boolean> ignoreCase)
Returns a comparator suitable for passing to a ViewerSorter
that will do a string comparison on two Composite s at
the given path.
|
Constructor Detail |
function ViewerSorter(comparator)
Method Detail |
int getIndexOf(<Object> newChild, <ArrayList> existingChildren)
newChild
- an object that is to be inserted into the list
existingChildren
- a list of objects that already exist in the viewer
existingChildren
at which newChild
should be inserted to maintain the ordering imposed by this sorter
void invert()
boolean isInverted()
true
if the current sort order is the same as
when the sorter was constructed, and false
if the current
sort order is inverted as compared to construct-time sort order.
true
or false
void setInverted(<boolean> inverted)
inverted
. After this call
completes, this.isInverted() == inverted
is true
.
inverted
- the desired inverted state
true
if something changed and false
otherwise
void sort(<ArrayList> children)
children
- a list of objects to be sorted
<static> function NUM_COMP(<number> numA, <number> numB)
int
s or float
s),
suitable for passing to a ViewerSorter
.
numA
- a number
numB
- a number
numA - numB
<static> int STR_COMP(<string> strA, <string> strB)
string
s, suitable for passing to a
ViewerSorter
.
strA
- a string
strB
- a string
strA
is less than strB
, 0 if they are equal, and 1 if strA
is greater than strB
.
<static> Function getChainedComparator()
ViewerSorter
that compares two values based on a sequence of prioritized keys.
<static> Function getCompositeComparator(<string> path, <boolean> ignoreCase)
ViewerSorter
that will do a string comparison on two Composite
s at
the given path.
path
- the path at which to compare the Composite
s passed into the resulting function
ignoreCase
- (Optional) - a flag indicating whether or not the returned comparator should perform case-insensitive string comparisons. Defaults to false
, which means case-sensitive comparisons.
Composite
s at the given path
|
Sydney | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |