atg.repository
Class SortDirective

java.lang.Object
  extended by atg.repository.SortDirective
All Implemented Interfaces:
SortingConstants

public class SortDirective
extends java.lang.Object
implements SortingConstants

A structure representing a single sorting directive in a SortDirectives object. Contains the name of the property to sort by, and the sorting direction, ascending (default) or descending.

See Also:
SortDirectives

Field Summary
static boolean CASE_INSENSITIVE
          Value used to indicate case insensitive sort
static boolean CASE_SENSITIVE
          Value used to indicate case sensitive sort
static java.lang.String CLASS_VERSION
          Class version string
static int DEFAULT_DIR
          Default direction value
static int DIR_ASCENDING
          Value used to indicate the ascending sort direction
static int DIR_DESCENDING
          Value used to indicate the descending sort direction
 
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
SortDirective()
          Constructs a new SortDirective.
SortDirective(java.lang.String pSortProperty)
          Constructs a new SortDirective with the specified property to sort by.
SortDirective(java.lang.String pSortProperty, int pSortDirection)
          Constructs a new SortDirective with the specified property to sort by and sort direction, which should be one of DIR_ASCENDING or DIR_DESCENDING.
SortDirective(java.lang.String pSortProperty, int pSortDirection, boolean pSortCaseSensitive)
          Constructs a new SortDirective with the specified property to sort by and sort direction and sort case sensitivity.
 
Method Summary
 SortDirective copy()
          Return a deep copy of this object.
 boolean equals(java.lang.Object obj)
          Returns true if the given SortDirective has the same property and sort direction as this one, and false otherwise.
 QueryExpression getPropertyExpression()
          Get property propertyExpression
 int getSortDirection()
          Returns the sort direction.
 java.lang.String getSortProperty()
          Returns the name of the property to sort by.
 int hashCode()
          Get an integer hash code for this object
 boolean isSortCaseSensitive()
          Returns true if the sort is case sensitive.
 void setPropertyExpression(QueryExpression pPropertyExpression)
          Set property propertyExpression
 void setSortCaseSensitive(boolean pSortCaseSensitive)
          Sets whether the sort is case sensitive or not.
 void setSortDirection(int pSortDirection)
          Sets the sort direction.
 void setSortProperty(java.lang.String pSortProperty)
          Sets the name of the property to sort by.
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


DIR_ASCENDING

public static final int DIR_ASCENDING
Value used to indicate the ascending sort direction

See Also:
Constant Field Values

DIR_DESCENDING

public static final int DIR_DESCENDING
Value used to indicate the descending sort direction

See Also:
Constant Field Values

DEFAULT_DIR

public static final int DEFAULT_DIR
Default direction value

See Also:
Constant Field Values

CASE_SENSITIVE

public static final boolean CASE_SENSITIVE
Value used to indicate case sensitive sort

See Also:
Constant Field Values

CASE_INSENSITIVE

public static final boolean CASE_INSENSITIVE
Value used to indicate case insensitive sort

See Also:
Constant Field Values
Constructor Detail

SortDirective

public SortDirective()
Constructs a new SortDirective.


SortDirective

public SortDirective(java.lang.String pSortProperty)
Constructs a new SortDirective with the specified property to sort by.

Parameters:
property - to sort by

SortDirective

public SortDirective(java.lang.String pSortProperty,
                     int pSortDirection)
Constructs a new SortDirective with the specified property to sort by and sort direction, which should be one of DIR_ASCENDING or DIR_DESCENDING.

Parameters:
property - to sort by
sort - direction, DIR_ASCENDING or DIR_DESCENDING.

SortDirective

public SortDirective(java.lang.String pSortProperty,
                     int pSortDirection,
                     boolean pSortCaseSensitive)
Constructs a new SortDirective with the specified property to sort by and sort direction and sort case sensitivity.

Parameters:
property - to sort by
sort - direction, DIR_ASCENDING or DIR_DESCENDING.
sort - case sensitivity, true or false
Method Detail

setPropertyExpression

public void setPropertyExpression(QueryExpression pPropertyExpression)
Set property propertyExpression

Parameters:
pPropertyExpression - new value to set

getPropertyExpression

public QueryExpression getPropertyExpression()
Get property propertyExpression

Returns:
propertyExpression

copy

public SortDirective copy()
Return a deep copy of this object.


getSortProperty

public java.lang.String getSortProperty()
Returns the name of the property to sort by.


setSortProperty

public void setSortProperty(java.lang.String pSortProperty)
Sets the name of the property to sort by.


getSortDirection

public int getSortDirection()
Returns the sort direction.


setSortDirection

public void setSortDirection(int pSortDirection)
Sets the sort direction.


isSortCaseSensitive

public boolean isSortCaseSensitive()
Returns true if the sort is case sensitive.


setSortCaseSensitive

public void setSortCaseSensitive(boolean pSortCaseSensitive)
Sets whether the sort is case sensitive or not.


toString

public java.lang.String toString(java.lang.String pIndent)
Returns the string representation of the object.

Parameters:
pIndent - string to place in front of string representation of this object

equals

public boolean equals(java.lang.Object obj)
Returns true if the given SortDirective has the same property and sort direction as this one, and false otherwise.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Get an integer hash code for this object

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code

toString

public java.lang.String toString()
Returns the string representation of the object.

Overrides:
toString in class java.lang.Object