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: import com.versant.core.common.BindingSupportImpl;
14:
15: /**
16: * This is a node with no children. Extending Node (which has children) to
17: * make this class may seem strange but lots of casting is saved in all the
18: * code the traverses Node trees.
19: */
20: public class LeafNode extends Node {
21:
22: /**
23: * Set the parent link on all our children.
24: */
25: public void setParentOnChildren() {
26: }
27:
28: /**
29: * Replace one node with another.
30: */
31: public void replaceChild(Node old, Node nw) {
32: throw BindingSupportImpl.getInstance().internal(
33: "replaceChild called on LeafNode");
34: }
35:
36: /**
37: * Simplify this node tree as much as possible.
38: */
39: public void normalizeImp() {
40: }
41:
42: public Field visit(MemVisitor visitor, Object obj) {
43: return visitor.visitLeafNode(this , obj);
44: }
45:
46: public Object arrive(NodeVisitor v, Object msg) {
47: return v.arriveLeafNode(this, msg);
48: }
49: }
|