KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > jdo > query > OrderNode


1
2 /*
3  * Copyright (c) 1998 - 2005 Versant Corporation
4  * All rights reserved. This program and the accompanying materials
5  * are made available under the terms of the Eclipse Public License v1.0
6  * which accompanies this distribution, and is available at
7  * http://www.eclipse.org/legal/epl-v10.html
8  *
9  * Contributors:
10  * Versant Corporation - initial API and implementation
11  */

12 package com.versant.core.jdo.query;
13
14 /**
15  * An order specification.
16  */

17 public class OrderNode extends Node {
18
19     public static final int ORDER_ASCENDING = 0;
20     public static final int ORDER_DESCENDING = 1;
21
22     public int order;
23
24     public OrderNode() {
25     }
26
27     public String JavaDoc toString() {
28         return super.toString() +
29             (order == ORDER_ASCENDING ? " ascending" : " descending");
30     }
31
32     public Field visit(MemVisitor visitor, Object JavaDoc obj) {
33         return visitor.visitOrderNode(this, obj);
34     }
35
36     public Object JavaDoc arrive(NodeVisitor v, Object JavaDoc msg) {
37         return v.arriveOrderNode(this, msg);
38     }
39
40     public Object JavaDoc accept(NodeVisitor v, Object JavaDoc[] results) {
41         return v.visitOrderNode(this, results);
42       }
43 }
44
45
Popular Tags