Statistics
| Revision:

root / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / instruction / LValueAdapter.java @ 466

History | View | Annotate | Download (1.26 KB)

1
/*
2
 * Created on 12-oct-2004
3
 */
4
package com.hardcode.gdbms.engine.instruction;
5

    
6
import com.hardcode.gdbms.engine.data.DriverException;
7
import com.hardcode.gdbms.engine.values.Value;
8

    
9

    
10
/**
11
 * Adaptador
12
 *
13
 * @author Fernando Gonz?lez Cort?s
14
 */
15
public class LValueAdapter extends AbstractExpression {
16
    /**
17
     * @see com.hardcode.gdbms.engine.instruction.Expression#getFieldName()
18
     */
19
    public String getFieldName() {
20
        return ((Expression) getChilds()[0]).getFieldName();
21
    }
22

    
23
    /**
24
     * @see com.hardcode.gdbms.engine.instruction.Expression#simplify()
25
     */
26
    public void simplify() {
27
        getParent().replaceChild(this, getChilds()[0]);
28
    }
29

    
30
    /**
31
     * @see com.hardcode.gdbms.engine.instruction.CachedExpression#evaluate(long)
32
     */
33
    public Value evaluate(long row) throws SemanticException, DriverException {
34
        return ((Expression) getChilds()[0]).evaluateExpression(row);
35
    }
36

    
37
    /**
38
     * @see com.hardcode.gdbms.engine.instruction.CachedExpression#isLiteral()
39
     */
40
    public boolean isLiteral() {
41
        return literal;
42
    }
43

    
44
        /**
45
         * @see com.hardcode.gdbms.engine.instruction.Expression#calculateLiteralCondition()
46
         */
47
        public void calculateLiteralCondition() {
48
                literal = ((Expression) getChilds()[0]).isLiteral();
49
        }
50
}