|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.repository.SortDirectives
public class SortDirectives
A structure representing a set of sorting directives. Contains an ordered list of SortDirective objects; the order of the objects implies the sorting order.
Sorting can be performed either by the Repository, through the executeQuery methods or as a post-processing step on the results. One can use the RepositorySorter class to sort an array of RepositoryItems.
SortDirective
,
RepositoryView.executeQuery(atg.repository.Query)
,
RepositorySorter
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
Fields inherited from interface atg.repository.SortingConstants |
---|
ASCENDING_ATTRIBUTE_VALUE, CASE_INSENSITIVE_ATTRIBUTE_VALUE, CASE_SENSITIVE_ATTRIBUTE_VALUE, DESCENDING_ATTRIBUTE_VALUE, DIR_ATTRIBUTE_NAME, SORTBY_TAG, SORTBYVALUE_TAG, VALUE_ATTRIBUTE_NAME |
Constructor Summary | |
---|---|
SortDirectives()
|
Method Summary | |
---|---|
void |
addDirective(SortDirective pDirective)
Adds the specified SortDirective to the end of the list of sort directives. |
void |
addDirective(SortDirective pDirective,
int pIndex)
Adds the specified SortDirective at the specified index in the list of sort directives. |
int |
compare(java.lang.Object pObject1,
java.lang.Object pObject2)
|
int |
compare(java.lang.String pString1,
java.lang.String pString2)
Compare two Strings in a locale-sensitive manner if we have a Collator, otherwise using String.compareTo() . |
SortDirectives |
copy()
Returns a deep copy of this object |
boolean |
equals(java.lang.Object obj)
Returns true if the given SortDirectives has same number of elements as this one and each individual SortDirective object in the given SortDirectives equals (via its equals method) the corresponding SortDirective in this SortDirectives object. |
java.text.Collator |
getCollator()
Get property collator |
SortDirective |
getDirective(int pIndex)
Returns the sort directive at the specified index. |
int |
getNumDirectives()
Returns the number of sort directives. |
int |
hashCode()
Return an integer hash code for this object |
boolean |
isEmpty()
Returns true if there are no sort directives. |
int |
order(java.lang.Object pObject1,
java.lang.Object pObject2)
Compares two objects as Dynamic Beans, based on the sorting directives contained in this object. |
void |
removeDirective(int pIndex)
Removes the sort directive at the specified index. |
void |
setCollator(java.text.Collator pCollator)
Set property collator |
java.lang.String |
toString()
Returns the string representation of the object. |
java.lang.String |
toString(java.lang.String pIndent)
Returns the string representation of the object, indenting the text using the specified pIndent string. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String CLASS_VERSION
Constructor Detail |
---|
public SortDirectives()
Method Detail |
---|
public SortDirectives copy()
public boolean isEmpty()
public int getNumDirectives()
public SortDirective getDirective(int pIndex)
public void addDirective(SortDirective pDirective)
public void addDirective(SortDirective pDirective, int pIndex)
public void removeDirective(int pIndex)
public void setCollator(java.text.Collator pCollator)
collator
pCollator
- new value to setpublic java.text.Collator getCollator()
collator
collator
public java.lang.String toString(java.lang.String pIndent)
public int order(java.lang.Object pObject1, java.lang.Object pObject2)
RepositorySorter uses this procedure to sort an array of RepositoryItems according to an order determined by a given SortDirectives object.
order
in interface atg.core.util.SortOrder
RepositoryItem
,
RepositorySorter.sort(atg.repository.RepositoryItem[], atg.repository.SortDirectives)
,
RepositorySorter.compare(java.lang.Object, java.lang.Object, int, boolean)
public int compare(java.lang.String pString1, java.lang.String pString2)
String.compareTo()
.
pString1
- first string to compare, cannot be nullpString2
- second string to compare, cannot be null
public final int compare(java.lang.Object pObject1, java.lang.Object pObject2)
compare
in interface java.util.Comparator
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface java.util.Comparator
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |