KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hansel > stack > PrefixOpEntry


1 package org.hansel.stack;
2
3
4 public class PrefixOpEntry extends OperatorEntry {
5     private HanselValue entry;
6
7     public PrefixOpEntry(String JavaDoc operator,
8                          int precedence,
9                          HanselValue entry) {
10         super(operator, precedence, entry.isBoolType(), entry.getSize());
11
12         this.entry = entry;
13     }
14
15     public PrefixOpEntry(String JavaDoc operator,
16                          int precedence,
17                          HanselValue entry,
18                          int size) {
19         super(operator, precedence, entry.isBoolType(), size);
20
21         this.entry = entry;
22     }
23
24     protected HanselValue getEntry() {
25         return entry;
26     }
27
28     public String JavaDoc toString() {
29         return super.toString() + toString(entry);
30     }
31
32     public HanselValue compress() {
33         try {
34             PrefixOpEntry result = (PrefixOpEntry) this.clone();
35             result.entry = entry.compress();
36             return result;
37         } catch (CloneNotSupportedException JavaDoc e) {
38             e.printStackTrace();
39             // Try to make the best of it...
40
return this;
41         }
42     }
43
44 }
45
Popular Tags