svn-gvsig-desktop / trunk / libraries / libGDBMS / src / com / hardcode / gdbms / engine / instruction / LiteralAdapter.java @ 466
History | View | Annotate | Download (1.27 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 |
import com.hardcode.gdbms.engine.values.ValueFactory; |
9 |
import com.hardcode.gdbms.parser.SimpleNode; |
10 |
|
11 |
|
12 |
/**
|
13 |
* Adaptador
|
14 |
*
|
15 |
* @author Fernando Gonz?lez Cort?s
|
16 |
*/
|
17 |
public class LiteralAdapter extends AbstractExpression { |
18 |
/**
|
19 |
* @see com.hardcode.gdbms.engine.instruction.Expression#getFieldName()
|
20 |
*/
|
21 |
public String getFieldName() { |
22 |
return null; |
23 |
} |
24 |
|
25 |
/**
|
26 |
* @see com.hardcode.gdbms.engine.instruction.Expression#simplify()
|
27 |
*/
|
28 |
public void simplify() { |
29 |
} |
30 |
|
31 |
/**
|
32 |
* @see com.hardcode.gdbms.engine.instruction.CachedExpression#evaluate(long)
|
33 |
*/
|
34 |
public Value evaluate(long row) throws SemanticException, DriverException { |
35 |
SimpleNode n = getEntity(); |
36 |
|
37 |
return ValueFactory.createValue(Utilities.getText(n), |
38 |
Utilities.getType(n));
|
39 |
} |
40 |
|
41 |
/**
|
42 |
* @see com.hardcode.gdbms.engine.instruction.CachedExpression#isLiteral()
|
43 |
*/
|
44 |
public boolean isLiteral() { |
45 |
return true; |
46 |
} |
47 |
|
48 |
/**
|
49 |
* @see com.hardcode.gdbms.engine.instruction.Expression#calculateLiteralCondition()
|
50 |
*/
|
51 |
public void calculateLiteralCondition() { |
52 |
} |
53 |
} |