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

View differences:

NumericalConstant.java
47 47
import com.iver.cit.gvsig.fmap.Messages;
48 48
/**
49 49
 * Implements the funcionality of a double constant
50
 * 
50
 *
51 51
 * @author Pepe Vidal Salvador - jose.vidal.salvador@iver.es
52 52
 *
53 53
 */
......
55 55
	private double doubleValue;
56 56
	private int integerValue;
57 57
	private boolean isDoubleValue = false;
58
	
58

  
59 59
	public String getName() {
60 60
		return OperationTags.NUMERIC_VALUE;
61 61
	}
62 62

  
63 63

  
64
	public NumericalConstant(Hashtable<String, Value> symbol_table) {
64

  
65
	public NumericalConstant(Object  value,Hashtable<String, Value> symbol_table) {
66

  
65 67
		super(symbol_table);
68

  
69
		if(value instanceof Integer) {
70
			integerValue = Integer.valueOf(value.toString());
71
		}
72
		else if (value instanceof Double) {
73
			doubleValue = Double.valueOf(value.toString());
74
			isDoubleValue = true;
75
		}
76

  
66 77
	}
67 78

  
68
	public Object evaluate(Hashtable<String, Value> symbol_table) {
69
		
79
	public Object evaluate() {
80

  
70 81
		if(isDoubleValue)
71 82
			return doubleValue;
72 83
		return integerValue;
......
107 118
	}
108 119

  
109 120

  
110
	public void check(Hashtable<String, Value> symbol_table) throws ExpressionException {
121
	public void check() throws ExpressionException {
111 122
		return;
112 123
	}
113 124

  

Also available in: Unified diff