KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > genimen > djeneric > repository > oql > core > nodes > IntegerNode


1 package com.genimen.djeneric.repository.oql.core.nodes;
2
3 import java.util.HashMap JavaDoc;
4
5 import com.genimen.djeneric.repository.oql.core.DjOqlParserEngine;
6 import com.genimen.djeneric.repository.oql.core.SimpleNode;
7
8 public class IntegerNode extends SimpleNode implements ValueExpression
9 {
10   Integer JavaDoc _value;
11
12   public IntegerNode(int i)
13   {
14     super(i);
15   }
16
17   public IntegerNode(DjOqlParserEngine p, int i)
18   {
19     super(p, i);
20   }
21
22   public String JavaDoc getName()
23   {
24     return toString();
25   }
26
27   public String JavaDoc toString()
28   {
29     return String.valueOf(_value.intValue());
30   }
31
32   public void setValue(int value)
33   {
34     _value = new Integer JavaDoc(value);
35   }
36
37   public Object JavaDoc getValue()
38   {
39     return _value;
40   }
41
42   public void translate(StringBuffer JavaDoc result, HashMap JavaDoc path2AliasMapping)
43   {
44     appendOpenBrackets(result);
45     result.append(_value);
46     appendCloseBrackets(result);
47   }
48
49   public Object JavaDoc getValue(MatchingContext context)
50   {
51     return _value;
52   }
53
54 }
Popular Tags