KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > genimen > djeneric > tools > generator > core > nodes > BoolNode


1 package com.genimen.djeneric.tools.generator.core.nodes;
2
3 import com.genimen.djeneric.tools.generator.core.DjentelParserEngine;
4 import com.genimen.djeneric.tools.generator.core.SimpleNode;
5 import com.genimen.djeneric.tools.generator.core.util.ParseContext;
6
7 public class BoolNode extends SimpleNode implements BooleanExpression, ValueExpression
8 {
9   private Boolean JavaDoc booleanValue;
10
11   public BoolNode(int i)
12   {
13     super(i);
14   }
15
16   public BoolNode(DjentelParserEngine p, int i)
17   {
18     super(p, i);
19   }
20
21   public String JavaDoc getName()
22   {
23     return toString();
24   }
25
26   public String JavaDoc toString()
27   {
28     return booleanValue.toString();
29   }
30
31   public void setValue(boolean value)
32   {
33     booleanValue = new Boolean JavaDoc(value);
34   }
35
36   public Object JavaDoc getValue(ParseContext context)
37   {
38     return booleanValue;
39   }
40
41   public boolean isTrue()
42   {
43     return booleanValue.booleanValue();
44   }
45
46   public boolean isTrue(ParseContext context)
47   {
48     return booleanValue.booleanValue();
49   }
50
51 }
52
Popular Tags