Statistics
| Revision:

svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / instruction / AbstractExpression.java @ 1956

History | View | Annotate | Download (695 Bytes)

1
package com.hardcode.gdbms.engine.instruction;
2

    
3
import com.hardcode.gdbms.engine.data.driver.DriverException;
4
import com.hardcode.gdbms.engine.values.Value;
5

    
6

    
7
/**
8
 * Adaptador
9
 *
10
 * @author Fernando Gonz?lez Cort?s
11
 */
12
public abstract class AbstractExpression extends Adapter implements Expression {
13
        protected boolean literal;
14
        private Value value;
15

    
16
        /**
17
         * @see com.hardcode.gdbms.engine.instruction.Expression#evaluateExpression(long)
18
         */
19
        public Value evaluateExpression(long row)
20
                throws SemanticException, DriverException {
21
                if (!isLiteral()) {
22
                        return evaluate(row);
23
                } else {
24
                        if (value == null) {
25
                                return (value = evaluate(row));
26
                        } else {
27
                                return value;
28
                        }
29
                }
30
        }
31
}