svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.library / org.gvsig.expressionevaluator / org.gvsig.expressionevaluator.lib / org.gvsig.expressionevaluator.lib.impl / src / main / java / org / gvsig / expressionevaluator / impl / DefaultToken.java @ 43809
History | View | Annotate | Download (1.13 KB)
1 |
package org.gvsig.expressionevaluator.impl; |
---|---|
2 |
|
3 |
import org.gvsig.expressionevaluator.LexicalAnalyzer.Token; |
4 |
|
5 |
public class DefaultToken implements Token { |
6 |
|
7 |
private int type; |
8 |
private String literal; |
9 |
private Object value; |
10 |
|
11 |
public DefaultToken() {
|
12 |
} |
13 |
|
14 |
@Override
|
15 |
public Token clone() throws CloneNotSupportedException { |
16 |
// We will assume that the properties of the class are immutable, so
|
17 |
// it would suffice to call the super class.
|
18 |
DefaultToken other = (DefaultToken) super.clone();
|
19 |
return other;
|
20 |
} |
21 |
|
22 |
|
23 |
@Override
|
24 |
public void set(int type, String literal) { |
25 |
this.set(type, literal, literal);
|
26 |
} |
27 |
|
28 |
@Override
|
29 |
public void set(int type, String literal, Object value) { |
30 |
this.literal = literal;
|
31 |
this.type = type;
|
32 |
this.value = value;
|
33 |
} |
34 |
|
35 |
@Override
|
36 |
public int getType() { |
37 |
return type;
|
38 |
} |
39 |
|
40 |
@Override
|
41 |
public Object getValue() { |
42 |
return value;
|
43 |
} |
44 |
|
45 |
@Override
|
46 |
public String getLiteral() { |
47 |
return literal;
|
48 |
} |
49 |
|
50 |
public void setLiteral(String literal) { |
51 |
this.literal = literal;
|
52 |
} |
53 |
|
54 |
} |