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

View differences:

IsNullOperator.java
46 46
import com.hardcode.gdbms.engine.values.Value;
47 47
import com.iver.cit.gvsig.fmap.Messages;
48 48
/**
49
 * 
50
 * Implements the funcionality of the IsNull operator which can be 
49
 *
50
 * Implements the funcionality of the IsNull operator which can be
51 51
 * used in a Filter Encoding expression
52
 * 
52
 *
53 53
 * @author Pepe Vidal Salvador - jose.vidal.salvador@iver.es
54 54
 *
55 55
 */
56
public class IsNullOperator implements Expression {
56
public class IsNullOperator extends Operator {
57 57

  
58

  
58 59
	private ArrayList<Expression> arguments = new ArrayList<Expression>();
59
	
60

  
60 61
	public String getName() {
61 62
		return OperationTags.ISNULL_OP;
62 63
	}
63
	
64

  
65

  
66
	public IsNullOperator(Hashtable<String, Value> symbol_table) {
67
		super(symbol_table);
68
	}
69

  
70

  
64 71
	public void addArgument(int i, Expression arg) {
65 72
		arguments.add(i, arg);
66 73
	}
67 74

  
68
	public Object evaluate(Hashtable<String, Value> symbol_table)throws ExpressionException {
69
		
75
	public Object evaluate()throws ExpressionException {
76

  
70 77
		if(arguments.size() > 1)
71 78
			throw new ExpressionException(ExpressionException.INCORRECT_NUMBER_OF_ARGUMENTS);
72
		
79

  
73 80
		else if(arguments.get(0)== null)
74 81
			return true;
75 82
		return false;
......
79 86
		return OperationTags.ISNULL_OP+"("
80 87
		+ Messages.getString(OperationTags.OPERAND) +")\n"+
81 88
		Messages.getString(OperationTags.OPERAND) +" = "+
82
		Messages.getString(OperationTags.NUMERIC_OR_BOOLEAN_CONSTANT);	
89
		Messages.getString(OperationTags.NUMERIC_OR_BOOLEAN_CONSTANT);
83 90
	}
84 91

  
85 92
	public ArrayList<Expression> getArguments() {
......
90 97
		this.arguments = arguments;
91 98
	}
92 99

  
93
	public void check(Hashtable<String, Value> symbol_table) throws ExpressionException {
100
	public void check() throws ExpressionException {
94 101
		if(arguments.size() != 1)
95 102
			throw new ExpressionException(ExpressionException.INCORRECT_NUMBER_OF_ARGUMENTS);
96 103
	}

Also available in: Unified diff