KickJava   Java API By Example, From Geeks To Geeks.

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


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 /**
15  * Entry in an update list.
16  */

17 public class SetNode extends Node {
18
19     private String JavaDoc identifier;
20     private String JavaDoc fieldName;
21     private Node value;
22
23     public SetNode(String JavaDoc identifier, String JavaDoc fieldName, Node value) {
24         this.identifier = identifier;
25         this.fieldName = fieldName;
26         this.value = value;
27     }
28
29     public String JavaDoc getIdentifier() {
30         return identifier;
31     }
32
33     public String JavaDoc getFieldName() {
34         return fieldName;
35     }
36
37     public Node getValue() {
38         return value;
39     }
40
41     public Object JavaDoc arrive(NodeVisitor v, Object JavaDoc msg) {
42         return v.arriveSetNode(this, msg);
43     }
44
45     public String JavaDoc toStringImp() {
46         StringBuffer JavaDoc s = new StringBuffer JavaDoc();
47         if (identifier != null) {
48             s.append(identifier);
49             s.append('.');
50         }
51         s.append(fieldName);
52         s.append(" = ");
53         s.append(value);
54         return s.toString();
55     }
56
57     public void resolve(ResolveContext rc) {
58         value.resolve(rc);
59     }
60
61 }
62
63
Popular Tags