Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.rd.kodo.query.exp
Class OrderExpression

    java.lang.Object
      |
      +--com.solarmetric.rd.kodo.query.exp.InMemoryExpression
            |
            +--com.solarmetric.rd.kodo.query.exp.OrderExpression

All Implemented Interfaces:
  java.util.Comparator, Expression

public class OrderExpression
extends InMemoryExpression
implements java.util.Comparator

Wraps another expression and orders its results.

Constructor Summary
`OrderExpression(com.solarmetric.rd.kodo.query.exp.InMemoryExpression exp, com.solarmetric.rd.kodo.query.exp.InMemoryValue val, boolean asc)` Constructor.

Method Summary
`int` | `compare(java.lang.Object o1, java.lang.Object o2)` Comparator that uses the result of eval'ing a Value to sort on.
`protected boolean` | `eval(java.lang.Object candidate, java.lang.Object orig, com.solarmetric.rd.kodo.runtime.PersistenceManagerImpl pm, java.util.Map params)` Evaluate the expression for the given context candidate and original candidate.
`void` | `order(java.util.List matches, com.solarmetric.rd.kodo.runtime.PersistenceManagerImpl pm, java.util.Map params)` Order the given list of matches according to this expression.

Methods inherited from class com.solarmetric.rd.kodo.query.exp.InMemoryExpression
`evaluate`

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

### OrderExpression

    public OrderExpression(com.solarmetric.rd.kodo.query.exp.InMemoryExpression exp,
                           com.solarmetric.rd.kodo.query.exp.InMemoryValue val,
                           boolean asc)

  Constructor. Supply delegate expression, the value to sort on, and the sort direction.

Method Detail

### eval

    protected boolean eval(java.lang.Object candidate,
                           java.lang.Object orig,
                           com.solarmetric.rd.kodo.runtime.PersistenceManagerImpl pm,
                           java.util.Map params)

  Description copied from class: `InMemoryExpression`
  Evaluate the expression for the given context candidate and original candidate.

  Overrides:
    `eval` in class `InMemoryExpression`

### order

    public void order(java.util.List matches,
                      com.solarmetric.rd.kodo.runtime.PersistenceManagerImpl pm,
                      java.util.Map params)

  Description copied from class: `InMemoryExpression`
  Order the given list of matches according to this expression.

  Overrides:
    `order` in class `InMemoryExpression`

### compare

    public int compare(java.lang.Object o1,
                       java.lang.Object o2)

  Comparator that uses the result of eval'ing a Value to sort on. Null values are placed last if sorting in ascending order, first if descending.

  Specified by:
    `compare` in interface `java.util.Comparator`

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.