org.apache.myfaces.trinidad.model
Class SortCriterion

java.lang.Object
  extended by org.apache.myfaces.trinidad.model.SortCriterion
All Implemented Interfaces:
Serializable

public class SortCriterion
extends Object
implements Serializable

This class bundles together a property, a direction and strength by which a CollectionModel can be sorted.

See Also:
CollectionModel.getSortCriteria(), Serialized Form

Constructor Summary
SortCriterion(String property, boolean isAscending)
          Construct SortCriterion instance by the given property and sort direction, using default Identical sort strength.
SortCriterion(String property, boolean isAscending, SortStrength sortStrength)
          Construct SortCriterion instance by the given property, sort direction, and sort strength.
 
Method Summary
 boolean equals(Object obj)
           
 String getProperty()
          Gets the property that is identified by this class.
 SortStrength getSortStrength()
          Gets the sort strenght of this sort criterion.
 int hashCode()
           
 boolean isAscending()
          Gets the direction in which the property of this class is sorted.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortCriterion

public SortCriterion(String property,
                     boolean isAscending)
Construct SortCriterion instance by the given property and sort direction, using default Identical sort strength.

Parameters:
property - sort property, name of the model that will be sorted on.
isAscending - whether to sort the property in ascending order or not.

SortCriterion

public SortCriterion(String property,
                     boolean isAscending,
                     SortStrength sortStrength)
Construct SortCriterion instance by the given property, sort direction, and sort strength.

Parameters:
property - sort property, name of the model that will be sorted on.
isAscending - whether to sort the property in ascending order or not.
sortStrength - sort strength value when performing sort.
Method Detail

isAscending

public boolean isAscending()
Gets the direction in which the property of this class is sorted.

Returns:
true if the property identified by this class is sorted in ascending order.

getProperty

public String getProperty()
Gets the property that is identified by this class. This is the property that must be sorted by. If a collection of beans is being sorted, bean rules will be used to find a suitable getter method that matches this property. The value returned by the getter method will be sorted on. If a collection of Maps is being sorted, this property will be used as the key into each Map to get at the value being sorted.


getSortStrength

public SortStrength getSortStrength()
Gets the sort strenght of this sort criterion. It controls how this column should be sorted, what level of difference considered significant during comparison.


equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2001-2012 The Apache Software Foundation. All Rights Reserved.