KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > ejb > query > NavRoot


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.ejb.query;
13
14 import com.versant.core.metadata.ClassMetaData;
15 import com.versant.core.common.CmdBitSet;
16
17 /**
18  * Root of tree navigated through fields starting at a class.
19  */

20 public class NavRoot extends NavBase {
21
22     private IdentificationVarNode node;
23     private ClassMetaData cmd; // the class starting this navigation
24

25     public NavRoot(IdentificationVarNode node, ClassMetaData cmd) {
26         this.node = node;
27         this.cmd = cmd;
28     }
29
30     public String JavaDoc getIdentifier() {
31         return getNode().getIdentifier();
32     }
33
34     public IdentificationVarNode getNode() {
35         return node;
36     }
37
38     public NavRoot getRoot() {
39         return this;
40     }
41
42     public ClassMetaData getNavClassMetaData() {
43         return cmd;
44     }
45
46     public String JavaDoc toString() {
47         StringBuffer JavaDoc s = new StringBuffer JavaDoc();
48         s.append(cmd.qname);
49         childrenToString(s);
50         return s.toString();
51     }
52
53 }
54
55
Popular Tags