Revision 22512 trunk/extensions/extSymbology/src/org/gvsig/symbology/fmap/rendering/filter/operations/StringConstant.java

View differences:

StringConstant.java
46 46
import com.hardcode.gdbms.engine.values.Value;
47 47
/**
48 48
 * Implements the funcionality of a String constant
49
 * 
49
 *
50 50
 * @author Pepe Vidal Salvador - jose.vidal.salvador@iver.es
51 51
 *
52 52
 */
53
public class StringConstant implements Expression
53
public class StringConstant extends Operator
54 54
{
55 55
	private String value;
56
  
57 56

  
57

  
58 58
	public String getName() {
59 59
		return OperationTags.STRING_CONSTANT;
60 60
	}
61
	
62
    public StringConstant(String value)
63
    {
64
        this.value = value;
65
    }
66 61

  
67
    public void addArgument(Expression function)
68
    {
69
        throw new RuntimeException("Cannot add an argument to a constant");
70
    }
71 62

  
72
    public void addArgument(int index, Expression expression)
73
    {
74
        throw new RuntimeException("Cannot add an argument to a constant");
75
    }
63
	public StringConstant(String value,Hashtable<String, Value> symbol_table)
64
	{
65
		super(symbol_table);
66
		this.value = value;
67
	}
76 68

  
77
    public Object evaluate(Hashtable<String, Value> symbol_table) {
69
	public void addArgument(Expression function)
70
	{
71
		throw new RuntimeException("Cannot add an argument to a constant");
72
	}
73

  
74
	public void addArgument(int index, Expression expression)
75
	{
76
		throw new RuntimeException("Cannot add an argument to a constant");
77
	}
78

  
79
	public Object evaluate() {
78 80
		return value;
79 81
	}
80 82

  
81 83
	public String getPattern() {
82 84
		return null;
83 85
	}
84
	
86

  
85 87
	public ArrayList<Expression> getArguments() {
86 88
		return null;
87 89
	}
......
90 92
		return;
91 93
	}
92 94

  
93
	public void check(Hashtable<String, Value> symbol_table) throws ExpressionException {
95
	public void check() throws ExpressionException {
94 96
		return;
95 97
	}
96 98

  
97 99
	public String getValue() {
98 100
		return value;
99 101
	}
102

  
103

  
100 104
}

Also available in: Unified diff