org.apache.openjpa.meta
Class InMemoryValueOrder

java.lang.Object
  extended by org.apache.openjpa.meta.InMemoryValueOrder
All Implemented Interfaces:
Serializable, Comparator, Order

 class InMemoryValueOrder
extends Object
implements Order, Comparator

Order by the field value in memory. If the field contains PersistenceCapable objects, order on their primary key values. Relies on primary key values, including datastore oid objects, being Comparable.

Author:
Abe White

Field Summary
 
Fields inherited from interface org.apache.openjpa.meta.Order
ELEMENT
 
Constructor Summary
InMemoryValueOrder(boolean asc, OpenJPAConfiguration conf)
           
 
Method Summary
 int compare(Object o1, Object o2)
           
 Comparator getComparator()
          Return a comparator for ordering by this element, or null if the ordering is done in the datastore.
 String getName()
          Return the name of the orderable.
 boolean isAscending()
          Order direction.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

InMemoryValueOrder

public InMemoryValueOrder(boolean asc,
                          OpenJPAConfiguration conf)
Method Detail

getName

public String getName()
Description copied from interface: Order
Return the name of the orderable.

Specified by:
getName in interface Order

isAscending

public boolean isAscending()
Description copied from interface: Order
Order direction.

Specified by:
isAscending in interface Order

getComparator

public Comparator getComparator()
Description copied from interface: Order
Return a comparator for ordering by this element, or null if the ordering is done in the datastore.

Specified by:
getComparator in interface Order

compare

public int compare(Object o1,
                   Object o2)
Specified by:
compare in interface Comparator


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.