org.beanfabrics.model
Class SortKey

java.lang.Object
  extended by org.beanfabrics.model.SortKey

public class SortKey
extends java.lang.Object

The SortKey describes the sort order for a field accessible by a particular Path relative to the element model.


Constructor Summary
SortKey(boolean ascending, Path sortPath)
          Creates a new SortKey for the specified Path with the specified sort direction.
 
Method Summary
 boolean equals(java.lang.Object obj)
          
 Path getSortPath()
          Returns the sort path.
 int hashCode()
          
 SortKey invert()
          Returns the inverted sortkey.
 boolean isAscending()
          Returns true if the sort direction is ascending, false otherwise.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SortKey

public SortKey(boolean ascending,
               Path sortPath)
Creates a new SortKey for the specified Path with the specified sort direction.

Parameters:
ascending - the sort direction
sortPath - the Path to the field relative to the element's root
Method Detail

getSortPath

public Path getSortPath()
Returns the sort path.

Returns:
the sort path

isAscending

public boolean isAscending()
Returns true if the sort direction is ascending, false otherwise.

Returns:
true if the sort direction is ascending, false otherwise

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

invert

public SortKey invert()
Returns the inverted sortkey. The inverted sortkey has the same sort path but an inverted ascending attibute.

Returns:
the inverted sortkey