01: /*
02: * Copyright (c) 1998 - 2005 Versant Corporation
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * Versant Corporation - initial API and implementation
10: */
11: package com.versant.core.jdo.query;
12:
13: /**
14: * An order specification.
15: */
16: public class OrderNode extends Node {
17:
18: public static final int ORDER_ASCENDING = 0;
19: public static final int ORDER_DESCENDING = 1;
20:
21: public int order;
22:
23: public OrderNode() {
24: }
25:
26: public String toString() {
27: return super .toString()
28: + (order == ORDER_ASCENDING ? " ascending"
29: : " descending");
30: }
31:
32: public Field visit(MemVisitor visitor, Object obj) {
33: return visitor.visitOrderNode(this , obj);
34: }
35:
36: public Object arrive(NodeVisitor v, Object msg) {
37: return v.arriveOrderNode(this , msg);
38: }
39:
40: public Object accept(NodeVisitor v, Object[] results) {
41: return v.visitOrderNode(this, results);
42: }
43: }
|