01: /*
02: * Copyright 2006 Day Management AG, Switzerland. All rights reserved.
03: */
04: package javax.jcr.query.qom;
05:
06: /**
07: * Determines the relative order of two node-tuples by evaluating
08: * {@link #getOperand operand} for each.
09: * <p/>
10: * For a first node-tuple, <code>nt1</code>, for which {@link #getOperand operand}
11: * evaluates to <code>v1</code>, and a second node-tuple, <code>nt2</code>, for
12: * which {@link #getOperand operand} evaluates to <code>v2</code>:
13: * <ul>
14: * <li>If {@link #getOrder order} is <code>Ascending</code>, then:<ul>
15: * <li>if either <code>v1</code> is null, <code>v2</code> is null, or both
16: * <code>v1</code> and <code>v2</code> are null, the relative order of
17: * <code>nt1</code> and <code>nt2</code> is implementation determined,
18: * otherwise</li>
19: * <li>if <code>v1</code> is a different property type than <code>v2</code>,
20: * the relative order of <code>nt1</code> and <code>nt2</code> is
21: * implementation determined, otherwise</li>
22: * <li>if <code>v1</code> is ordered before <code>v2</code>, then
23: * <code>nt1</code> precedes <code>nt2</code>, otherwise</li>
24: * <li>if <code>v1</code> is ordered after <code>v2</code>, then
25: * <code>nt2</code> precedes <code>nt1</code>, otherwise</li>
26: * <li>the relative order of <code>nt1</code> and <code>nt2</code> is
27: * implementation determined and may be arbitrary.</li></ul></li>
28: * <li>Otherwise, if {@link #getOrder order} is <code>Descending</code>, then:<ul>
29: * <li>if either <code>v1</code> is null, <code>v2</code> is null, or both
30: * <code>v1</code> and <code>v2</code> are null, the relative order of
31: * <code>nt1</code> and <code>nt2</code> is implementation determined,
32: * otherwise</li>
33: * <li>if <code>v1</code> is a different property type than <code>v2</code>,
34: * the relative order of <code>nt1</code> and <code>nt2</code> is
35: * implementation determined, otherwise</li>
36: * <li>if <code>v1</code> is ordered before <code>v2</code>, then
37: * <code>nt2</code> precedes <code>nt1</code>, otherwise</li>
38: * <li>if <code>v1</code> is ordered after <code>v2</code>, then
39: * <code>nt1</code> precedes <code>nt2</code>, otherwise</li>
40: * <li>the relative order of <code>nt1</code> and <code>nt2</code> is
41: * implementation determined and may be arbitrary.</li></ul></li>
42: * </ul>
43: * The query is invalid if {@link #getOperand operand} does not evaluate to a
44: * scalar value.
45: *
46: * @since JCR 2.0
47: */
48: public interface Ordering {
49: /**
50: * The operand by which to order.
51: *
52: * @return the operand; non-null
53: */
54: public DynamicOperand getOperand();
55:
56: /**
57: * Gets the order.
58: *
59: * @return either
60: * <ul>
61: * <li>{@link QueryObjectModelConstants#ORDER_ASCENDING} or</li>
62: * <li>{@link QueryObjectModelConstants#ORDER_DESCENDING}</li>
63: * </ul>
64: */
65: public int getOrder();
66: }
67:
68: // EOF
|