jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thom...@apache.org
Subject svn commit: r1305825 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/query/ main/java/org/apache/jackrabbit/oak/query/ast/ main/java/org/apache/jackrabbit/oak/query/index/ test/java/org/apache/jackrabbit/oak/query/ test/jav...
Date Tue, 27 Mar 2012 12:50:10 GMT
Author: thomasm
Date: Tue Mar 27 12:50:09 2012
New Revision: 1305825

URL: http://svn.apache.org/viewvc?rev=1305825&view=rev
Log:
OAK-33 Values in oak-core (within the query engine)

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/CoreValue.java
      - copied, changed from r1305822, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarImpl.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarType.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngine.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Row.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarFactory.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java
    jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/CoreValue.java (from r1305822, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarImpl.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/CoreValue.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/CoreValue.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarImpl.java&r1=1305822&r2=1305825&rev=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/CoreValue.java Tue Mar 27 12:50:09 2012
@@ -18,12 +18,26 @@ package org.apache.jackrabbit.oak.query;
 
 import java.math.BigDecimal;
 
-public class ScalarImpl implements Comparable<ScalarImpl> {
+public class CoreValue implements Comparable<CoreValue> {
+
+    public static final int UNDEFINED = 0;
+    public static final int STRING = 1;
+    public static final int BINARY = 2;
+    public static final int LONG = 3;
+    public static final int DOUBLE = 4;
+    public static final int DATE = 5;
+    public static final int BOOLEAN = 6;
+    public static final int NAME = 7;
+    public static final int PATH = 8;
+    public static final int REFERENCE = 9;
+    public static final int WEAKREFERENCE = 10;
+    public static final int URI = 11;
+    public static final int DECIMAL = 12;
 
     private final Object value;
     private final int type;
 
-    public ScalarImpl(Object value, int type) {
+    public CoreValue(Object value, int type) {
         this.value = value;
         this.type = type;
     }
@@ -76,15 +90,15 @@ public class ScalarImpl implements Compa
         if (this == o) {
             return true;
         }
-        if (!(o instanceof ScalarImpl)) {
+        if (!(o instanceof CoreValue)) {
             return false;
         }
-        ScalarImpl v = (ScalarImpl) o;
+        CoreValue v = (CoreValue) o;
         return type == v.type && value.equals(v.value);
     }
 
     @Override
-    public int compareTo(ScalarImpl o) {
+    public int compareTo(CoreValue o) {
         if (this == o) {
             return 0;
         }
@@ -93,13 +107,13 @@ public class ScalarImpl implements Compa
             return type - o.type;
         }
         switch (type) {
-        case ScalarType.LONG:
+        case LONG:
             return ((Long) value).compareTo((Long) o.value);
-        case ScalarType.DOUBLE:
+        case DOUBLE:
             return ((Double) value).compareTo((Double) o.value);
-        case ScalarType.DECIMAL:
+        case DECIMAL:
             return ((BigDecimal) value).compareTo((BigDecimal) o.value);
-        case ScalarType.BOOLEAN:
+        case BOOLEAN:
             return ((Boolean) value).compareTo((Boolean) o.value);
         }
         return value.toString().compareTo(o.toString());

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Query.java Tue Mar 27 12:50:09 2012
@@ -53,7 +53,7 @@ public class Query {
 
     final SourceImpl source;
     final ConstraintImpl constraint;
-    final HashMap<String, ScalarImpl> bindVariableMap = new HashMap<String, ScalarImpl>();
+    final HashMap<String, CoreValue> bindVariableMap = new HashMap<String, CoreValue>();
     final ArrayList<SelectorImpl> selectors = new ArrayList<SelectorImpl>();
 
     private MicroKernel mk;
@@ -236,7 +236,7 @@ public class Query {
         return source;
     }
 
-    void bindValue(String varName, ScalarImpl value) {
+    void bindValue(String varName, CoreValue value) {
         bindVariableMap.put(varName, value);
     }
 
@@ -265,7 +265,7 @@ public class Query {
         if (explain) {
             String plan = source.getPlan();
             columns = new ColumnImpl[] { new ColumnImpl("explain", "plan", "plan")};
-            Row r = new Row(this, new String[0], new ScalarImpl[] { valueFactory.createValue(plan) }, null);
+            Row r = new Row(this, new String[0], new CoreValue[] { valueFactory.createValue(plan) }, null);
             return Arrays.asList(r).iterator();
         }
         RowIterator it = new RowIterator(revisionId);
@@ -282,11 +282,11 @@ public class Query {
         return list.iterator();
     }
 
-    public int compareRows(ScalarImpl[] orderValues, ScalarImpl[] orderValues2) {
+    public int compareRows(CoreValue[] orderValues, CoreValue[] orderValues2) {
         int comp = 0;
         for (int i = 0, size = orderings.length; i < size; i++) {
-            ScalarImpl a = orderValues[i];
-            ScalarImpl b = orderValues2[i];
+            CoreValue a = orderValues[i];
+            CoreValue b = orderValues2[i];
             if (a == null || b == null) {
                 if (a == b) {
                     comp = 0;
@@ -387,17 +387,17 @@ public class Query {
             paths[i] = s.currentPath();
         }
         int columnCount = columns.length;
-        ScalarImpl[] values = new ScalarImpl[columnCount];
+        CoreValue[] values = new CoreValue[columnCount];
         for (int i = 0; i < columnCount; i++) {
             ColumnImpl c = columns[i];
             values[i] = c.currentValue();
         }
-        ScalarImpl[] orderValues;
+        CoreValue[] orderValues;
         if (orderings == null) {
             orderValues = null;
         } else {
             int size = orderings.length;
-            orderValues = new ScalarImpl[size];
+            orderValues = new CoreValue[size];
             for (int i = 0; i < size; i++) {
                 orderValues[i] = orderings[i].getOperand().currentValue();
             }
@@ -432,8 +432,8 @@ public class Query {
         return offset;
     }
 
-    public ScalarImpl getBindVariableValue(String bindVariableName) {
-        ScalarImpl v = bindVariableMap.get(bindVariableName);
+    public CoreValue getBindVariableValue(String bindVariableName) {
+        CoreValue v = bindVariableMap.get(bindVariableName);
         if (v == null) {
             throw new RuntimeException("Bind variable value not set: " + bindVariableName);
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngine.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngine.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngine.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/QueryEngine.java Tue Mar 27 12:50:09 2012
@@ -40,7 +40,7 @@ public class QueryEngine {
         return new QueryEngine(mk);
     }
 
-    public Iterator<Row> executeQuery(String language, String query, Map<String, ScalarImpl> bindings) throws ParseException {
+    public Iterator<Row> executeQuery(String language, String query, Map<String, CoreValue> bindings) throws ParseException {
         Query q;
         if (SQL2.equals(language)) {
             q = parserSQL2.parse(query);
@@ -53,7 +53,7 @@ public class QueryEngine {
         }
         q.setMicroKernel(mk);
         if (bindings != null) {
-            for (Entry<String, ScalarImpl> e : bindings.entrySet()) {
+            for (Entry<String, CoreValue> e : bindings.entrySet()) {
                 q.bindValue(e.getKey(), e.getValue());
             }
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Row.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Row.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Row.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Row.java Tue Mar 27 12:50:09 2012
@@ -26,10 +26,10 @@ public class Row implements Comparable<R
 
     private final Query query;
     private final String[] paths;
-    private final ScalarImpl[] values;
-    private final ScalarImpl[] orderValues;
+    private final CoreValue[] values;
+    private final CoreValue[] orderValues;
 
-    Row(Query query, String[] paths, ScalarImpl[] values, ScalarImpl[] orderValues) {
+    Row(Query query, String[] paths, CoreValue[] values, CoreValue[] orderValues) {
         this.query = query;
         this.paths = paths;
         this.values = values;
@@ -51,12 +51,12 @@ public class Row implements Comparable<R
         return paths[index];
     }
 
-    public ScalarImpl getValue(String columnName) {
+    public CoreValue getValue(String columnName) {
         return values[query.getColumnIndex(columnName)];
     }
 
-    public ScalarImpl[] getValues() {
-        ScalarImpl[] v2 = new ScalarImpl[values.length];
+    public CoreValue[] getValues() {
+        CoreValue[] v2 = new CoreValue[values.length];
         System.arraycopy(values, 0, v2, 0, v2.length);
         return v2;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/SQL2Parser.java Tue Mar 27 12:50:09 2012
@@ -61,7 +61,7 @@ public class SQL2Parser {
     private int currentTokenType;
     private String currentToken;
     private boolean currentTokenQuoted;
-    private ScalarImpl currentValue;
+    private CoreValue currentValue;
     private ArrayList<String> expected;
 
     // The bind variables
@@ -136,7 +136,7 @@ public class SQL2Parser {
     private String readName() throws ParseException {
         if (readIf("[")) {
             if (currentTokenType == VALUE) {
-                ScalarImpl value = readString();
+                CoreValue value = readString();
                 read("]");
                 return value.getString();
             } else {
@@ -442,16 +442,16 @@ public class SQL2Parser {
             }
             int valueType = currentValue.getType();
             switch (valueType) {
-            case ScalarType.LONG:
+            case CoreValue.LONG:
                 currentValue = valueFactory.createValue(-currentValue.getLong());
                 break;
-            case ScalarType.DOUBLE:
+            case CoreValue.DOUBLE:
                 currentValue = valueFactory.createValue(-currentValue.getDouble());
                 break;
-            case ScalarType.BOOLEAN:
+            case CoreValue.BOOLEAN:
                 currentValue = valueFactory.createValue(!currentValue.getBoolean());
                 break;
-            case ScalarType.DECIMAL:
+            case CoreValue.DECIMAL:
                 currentValue = valueFactory.createValue(currentValue.getDecimal().negate());
                 break;
             default:
@@ -487,7 +487,7 @@ public class SQL2Parser {
                 throw getSyntaxError("literal");
             }
             LiteralImpl literal = (LiteralImpl) op;
-            ScalarImpl value = literal.getLiteralValue();
+            CoreValue value = literal.getLiteralValue();
             read("AS");
             value = parseCastAs(value);
             read(")");
@@ -505,11 +505,11 @@ public class SQL2Parser {
      * @param value the original value
      * @return the literal
      */
-    private LiteralImpl getUncastLiteral(ScalarImpl value) throws ParseException {
+    private LiteralImpl getUncastLiteral(CoreValue value) throws ParseException {
         return factory.literal(value);
     }
 
-    private ScalarImpl parseCastAs(ScalarImpl value) throws ParseException {
+    private CoreValue parseCastAs(CoreValue value) throws ParseException {
         if (readIf("STRING")) {
             return valueFactory.createValue(value.getString());
         } else if (readIf("BINARY")) {
@@ -525,15 +525,15 @@ public class SQL2Parser {
         } else if (readIf("BOOLEAN")) {
             return valueFactory.createValue(value.getBoolean());
         } else if (readIf("NAME")) {
-            return valueFactory.createValue(value.getString(), ScalarType.NAME);
+            return valueFactory.createValue(value.getString(), CoreValue.NAME);
         } else if (readIf("PATH")) {
-            return valueFactory.createValue(value.getString(), ScalarType.PATH);
+            return valueFactory.createValue(value.getString(), CoreValue.PATH);
         } else if (readIf("REFERENCE")) {
-            return valueFactory.createValue(value.getString(), ScalarType.REFERENCE);
+            return valueFactory.createValue(value.getString(), CoreValue.REFERENCE);
         } else if (readIf("WEAKREFERENCE")) {
-            return valueFactory.createValue(value.getString(), ScalarType.WEAKREFERENCE);
+            return valueFactory.createValue(value.getString(), CoreValue.WEAKREFERENCE);
         } else if (readIf("URI")) {
-            return valueFactory.createValue(value.getString(), ScalarType.URI);
+            return valueFactory.createValue(value.getString(), CoreValue.URI);
         } else {
             throw getSyntaxError("data type (STRING|BINARY|...)");
         }
@@ -654,11 +654,11 @@ public class SQL2Parser {
         return s;
     }
 
-    private ScalarImpl readString() throws ParseException {
+    private CoreValue readString() throws ParseException {
         if (currentTokenType != VALUE) {
             throw getSyntaxError("string value");
         }
-        ScalarImpl value = currentValue;
+        CoreValue value = currentValue;
         read();
         return value;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarFactory.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarFactory.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ScalarFactory.java Tue Mar 27 12:50:09 2012
@@ -20,28 +20,28 @@ import java.math.BigDecimal;
 
 public class ScalarFactory {
 
-    public ScalarImpl createValue(String value) {
-        return new ScalarImpl(value, ScalarType.STRING);
+    public CoreValue createValue(String value) {
+        return new CoreValue(value, CoreValue.STRING);
     }
 
-    public ScalarImpl createValue(BigDecimal value) {
-        return new ScalarImpl(value, ScalarType.DECIMAL);
+    public CoreValue createValue(BigDecimal value) {
+        return new CoreValue(value, CoreValue.DECIMAL);
     }
 
-    public ScalarImpl createValue(double value) {
-        return new ScalarImpl(value, ScalarType.DOUBLE);
+    public CoreValue createValue(double value) {
+        return new CoreValue(value, CoreValue.DOUBLE);
     }
 
-    public ScalarImpl createValue(long value) {
-        return new ScalarImpl(value, ScalarType.LONG);
+    public CoreValue createValue(long value) {
+        return new CoreValue(value, CoreValue.LONG);
     }
 
-    public ScalarImpl createValue(boolean value) {
-        return new ScalarImpl(value, ScalarType.BOOLEAN);
+    public CoreValue createValue(boolean value) {
+        return new CoreValue(value, CoreValue.BOOLEAN);
     }
 
-    public ScalarImpl createValue(String value, int type) {
-        return new ScalarImpl(value, type);
+    public CoreValue createValue(String value, int type) {
+        return new CoreValue(value, type);
     }
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/AstElementFactory.java Tue Mar 27 12:50:09 2012
@@ -13,7 +13,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 
 /**
  * A factory for syntax tree elements.
@@ -84,7 +84,7 @@ public class AstElementFactory {
         return new LengthImpl(propertyValue);
     }
 
-    public LiteralImpl literal(ScalarImpl literalValue) {
+    public LiteralImpl literal(CoreValue literalValue) {
         return new LiteralImpl(literalValue);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/BindVariableValueImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 
 public class BindVariableValueImpl extends StaticOperandImpl {
 
@@ -43,7 +43,7 @@ public class BindVariableValueImpl exten
     }
 
     @Override
-    ScalarImpl currentValue() {
+    CoreValue currentValue() {
         return query.getBindVariableValue(bindVariableName);
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ColumnImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 
 public class ColumnImpl extends AstElement {
 
@@ -58,7 +58,7 @@ public class ColumnImpl extends AstEleme
         }
     }
 
-    public ScalarImpl currentValue() {
+    public CoreValue currentValue() {
         if (propertyName == null) {
             // TODO for SELECT * FROM queries, currently return the path (for testing only)
             String p = selector.currentPath();

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/ComparisonImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.ScalarFactory;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
@@ -48,8 +48,8 @@ public class ComparisonImpl extends Cons
 
     @Override
     public boolean evaluate() {
-        ScalarImpl v1 = operand1.currentValue();
-        ScalarImpl v2 = operand2.currentValue();
+        CoreValue v1 = operand1.currentValue();
+        CoreValue v2 = operand2.currentValue();
         if (v1 == null || v2 == null) {
             // TODO comparison: what about (null <> x) ?
             return false;
@@ -71,7 +71,7 @@ public class ComparisonImpl extends Cons
         return false;
     }
 
-    private static boolean evaluateLike(ScalarImpl v1, ScalarImpl v2) {
+    private static boolean evaluateLike(CoreValue v1, CoreValue v2) {
         LikePattern like = new LikePattern(v2.getString());
         return like.matches(v1.getString());
     }
@@ -255,7 +255,7 @@ public class ComparisonImpl extends Cons
 
     @Override
     public void apply(Filter f) {
-        ScalarImpl v = operand2.currentValue();
+        CoreValue v = operand2.currentValue();
         if (v != null) {
             if (operator == Operator.LIKE) {
                 String pattern;

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/DynamicOperandImpl.java Tue Mar 27 12:50:09 2012
@@ -16,13 +16,13 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public abstract class DynamicOperandImpl extends AstElement {
 
-    public abstract ScalarImpl currentValue();
+    public abstract CoreValue currentValue();
 
-    public abstract void apply(Filter f, Operator operator, ScalarImpl v);
+    public abstract void apply(Filter f, Operator operator, CoreValue v);
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/EquiJoinConditionImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class EquiJoinConditionImpl extends JoinConditionImpl {
@@ -79,19 +79,19 @@ public class EquiJoinConditionImpl exten
 
     @Override
     public boolean evaluate() {
-        ScalarImpl v1 = selector1.currentProperty(property1Name);
+        CoreValue v1 = selector1.currentProperty(property1Name);
         if (v1 == null) {
             return false;
         }
         // TODO data type mapping
-        ScalarImpl v2 = selector2.currentProperty(property2Name);
+        CoreValue v2 = selector2.currentProperty(property2Name);
         return v2 != null && v1.equals(v2);
     }
 
     @Override
     public void apply(Filter f) {
-        ScalarImpl v1 = selector1.currentProperty(property1Name);
-        ScalarImpl v2 = selector2.currentProperty(property2Name);
+        CoreValue v1 = selector1.currentProperty(property1Name);
+        CoreValue v2 = selector2.currentProperty(property2Name);
         if (f.getSelector() == selector1 && v2 != null) {
             f.restrictProperty(property1Name, Operator.EQUAL, v2);
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/FullTextSearchScoreImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class FullTextSearchScoreImpl extends DynamicOperandImpl {
@@ -44,13 +44,13 @@ public class FullTextSearchScoreImpl ext
     }
 
     @Override
-    public ScalarImpl currentValue() {
+    public CoreValue currentValue() {
         // TODO support evaluating fulltext conditions (score)
         return null;
     }
 
     @Override
-    public void apply(Filter f, Operator operator, ScalarImpl v) {
+    public void apply(Filter f, Operator operator, CoreValue v) {
         // TODO support fulltext index conditions (score)
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LengthImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class LengthImpl extends DynamicOperandImpl {
@@ -44,8 +44,8 @@ public class LengthImpl extends DynamicO
     }
 
     @Override
-    public ScalarImpl currentValue() {
-        ScalarImpl v = propertyValue.currentValue();
+    public CoreValue currentValue() {
+        CoreValue v = propertyValue.currentValue();
         if (v == null) {
             return null;
         }
@@ -55,7 +55,7 @@ public class LengthImpl extends DynamicO
     }
 
     @Override
-    public void apply(Filter f, Operator operator, ScalarImpl v) {
+    public void apply(Filter f, Operator operator, CoreValue v) {
         // ignore
         // TODO LENGTH(x) conditions: can use IS NOT NULL?
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LiteralImpl.java Tue Mar 27 12:50:09 2012
@@ -19,18 +19,17 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.oak.query.SQL2Parser;
-import org.apache.jackrabbit.oak.query.ScalarImpl;
-import org.apache.jackrabbit.oak.query.ScalarType;
+import org.apache.jackrabbit.oak.query.CoreValue;
 
 public class LiteralImpl extends StaticOperandImpl {
 
-    private final ScalarImpl value;
+    private final CoreValue value;
 
-    public LiteralImpl(ScalarImpl value) {
+    public LiteralImpl(CoreValue value) {
         this.value = value;
     }
 
-    public ScalarImpl getLiteralValue() {
+    public CoreValue getLiteralValue() {
         return value;
     }
 
@@ -42,28 +41,28 @@ public class LiteralImpl extends StaticO
     @Override
     public String toString() {
         switch (value.getType()) {
-        case ScalarType.BINARY:
+        case CoreValue.BINARY:
             return cast("BINARY");
-        case ScalarType.BOOLEAN:
+        case CoreValue.BOOLEAN:
             return cast("BOOLEAN");
-        case ScalarType.DATE:
+        case CoreValue.DATE:
             return cast("DATE");
-        case ScalarType.DECIMAL:
+        case CoreValue.DECIMAL:
             return cast("DECIMAL");
-        case ScalarType.DOUBLE:
-        case ScalarType.LONG:
+        case CoreValue.DOUBLE:
+        case CoreValue.LONG:
             return value.getString();
-        case ScalarType.NAME:
+        case CoreValue.NAME:
             return cast("NAME");
-        case ScalarType.PATH:
+        case CoreValue.PATH:
             return cast("PATH");
-        case ScalarType.REFERENCE:
+        case CoreValue.REFERENCE:
             return cast("REFERENCE");
-        case ScalarType.STRING:
+        case CoreValue.STRING:
             return escape();
-        case ScalarType.URI:
+        case CoreValue.URI:
             return cast("URI");
-        case ScalarType.WEAKREFERENCE:
+        case CoreValue.WEAKREFERENCE:
             return cast("WEAKREFERENCE");
         default:
             return escape();
@@ -79,7 +78,7 @@ public class LiteralImpl extends StaticO
     }
 
     @Override
-    ScalarImpl currentValue() {
+    CoreValue currentValue() {
         return value;
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/LowerCaseImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class LowerCaseImpl extends DynamicOperandImpl {
@@ -44,8 +44,8 @@ public class LowerCaseImpl extends Dynam
     }
 
     @Override
-    public ScalarImpl currentValue() {
-        ScalarImpl v = operand.currentValue();
+    public CoreValue currentValue() {
+        CoreValue v = operand.currentValue();
         if (v == null) {
             return null;
         }
@@ -54,7 +54,7 @@ public class LowerCaseImpl extends Dynam
     }
 
     @Override
-    public void apply(Filter f, Operator operator, ScalarImpl v) {
+    public void apply(Filter f, Operator operator, CoreValue v) {
         // ignore
         // TODO UPPER(x) conditions: can use IS NOT NULL?
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeLocalNameImpl.java Tue Mar 27 12:50:09 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.util.PathUtils;
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class NodeLocalNameImpl extends DynamicOperandImpl {
@@ -53,7 +53,7 @@ public class NodeLocalNameImpl extends D
     }
 
     @Override
-    public  ScalarImpl currentValue() {
+    public  CoreValue currentValue() {
         String name = PathUtils.getName(selector.currentPath());
         int colon = name.indexOf(':');
         // TODO LOCALNAME: evaluation of local name might not be correct
@@ -62,7 +62,7 @@ public class NodeLocalNameImpl extends D
     }
 
     @Override
-    public void apply(Filter f, Operator operator, ScalarImpl v) {
+    public void apply(Filter f, Operator operator, CoreValue v) {
         // TODO support LOCALNAME index conditions
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/NodeNameImpl.java Tue Mar 27 12:50:09 2012
@@ -19,7 +19,7 @@
 package org.apache.jackrabbit.oak.query.ast;
 
 import org.apache.jackrabbit.mk.util.PathUtils;
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class NodeNameImpl extends DynamicOperandImpl {
@@ -53,13 +53,13 @@ public class NodeNameImpl extends Dynami
     }
 
     @Override
-    public  ScalarImpl currentValue() {
+    public  CoreValue currentValue() {
         String name = PathUtils.getName(selector.currentPath());
         return query.getValueFactory().createValue(name);
     }
 
     @Override
-    public void apply(Filter f, Operator operator, ScalarImpl v) {
+    public void apply(Filter f, Operator operator, CoreValue v) {
         // TODO support NAME(..) index conditions
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyExistenceImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class PropertyExistenceImpl extends ConstraintImpl {
@@ -42,7 +42,7 @@ public class PropertyExistenceImpl exten
 
     @Override
     public boolean evaluate() {
-        ScalarImpl v = selector.currentProperty(propertyName);
+        CoreValue v = selector.currentProperty(propertyName);
         return v != null;
     }
 
@@ -67,7 +67,7 @@ public class PropertyExistenceImpl exten
     @Override
     public void apply(Filter f) {
         if (f.getSelector() == selector) {
-            f.restrictProperty(propertyName, Operator.NOT_EQUAL, (ScalarImpl) null);
+            f.restrictProperty(propertyName, Operator.NOT_EQUAL, (CoreValue) null);
         }
     }
 

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/PropertyValueImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class PropertyValueImpl extends DynamicOperandImpl {
@@ -52,7 +52,7 @@ public class PropertyValueImpl extends D
     }
 
     @Override
-    public ScalarImpl currentValue() {
+    public CoreValue currentValue() {
         return selector.currentProperty(propertyName);
     }
 
@@ -64,7 +64,7 @@ public class PropertyValueImpl extends D
     }
 
     @Override
-    public void apply(Filter f, Operator operator, ScalarImpl v) {
+    public void apply(Filter f, Operator operator, CoreValue v) {
         if (f.getSelector() == selector) {
             f.restrictProperty(propertyName, operator, v);
         }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/SelectorImpl.java Tue Mar 27 12:50:09 2012
@@ -22,7 +22,7 @@ import org.apache.jackrabbit.mk.api.Micr
 import org.apache.jackrabbit.mk.json.JsopTokenizer;
 import org.apache.jackrabbit.mk.simple.NodeImpl;
 import org.apache.jackrabbit.oak.query.Query;
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Cursor;
 import org.apache.jackrabbit.oak.query.index.Filter;
 import org.apache.jackrabbit.oak.query.index.NodeReader;
@@ -108,7 +108,7 @@ public class SelectorImpl extends Source
         return cursor == null ? null : cursor.currentNode();
     }
 
-    public ScalarImpl currentProperty(String propertyName) {
+    public CoreValue currentProperty(String propertyName) {
         if (propertyName.equals(PATH)) {
             String p = currentPath();
             return p == null ? null : query.getValueFactory().createValue(p);

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/StaticOperandImpl.java Tue Mar 27 12:50:09 2012
@@ -18,10 +18,10 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 
 public abstract class StaticOperandImpl extends AstElement {
 
-    abstract ScalarImpl currentValue();
+    abstract CoreValue currentValue();
 
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/ast/UpperCaseImpl.java Tue Mar 27 12:50:09 2012
@@ -18,7 +18,7 @@
  */
 package org.apache.jackrabbit.oak.query.ast;
 
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.index.Filter;
 
 public class UpperCaseImpl extends DynamicOperandImpl {
@@ -44,8 +44,8 @@ public class UpperCaseImpl extends Dynam
     }
 
     @Override
-    public ScalarImpl currentValue() {
-        ScalarImpl v = operand.currentValue();
+    public CoreValue currentValue() {
+        CoreValue v = operand.currentValue();
         if (v == null) {
             return null;
         }
@@ -54,7 +54,7 @@ public class UpperCaseImpl extends Dynam
     }
 
     @Override
-    public void apply(Filter f, Operator operator, ScalarImpl v) {
+    public void apply(Filter f, Operator operator, CoreValue v) {
         // ignore
         // TODO UPPER(x) conditions: can use IS NOT NULL?
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/index/Filter.java Tue Mar 27 12:50:09 2012
@@ -21,7 +21,7 @@ package org.apache.jackrabbit.oak.query.
 import java.util.HashMap;
 import java.util.Map.Entry;
 import org.apache.jackrabbit.mk.util.PathUtils;
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.query.ast.SelectorImpl;
 
@@ -107,7 +107,7 @@ public class Filter {
         /**
          * The first value to read, or null to read from the beginning.
          */
-        public ScalarImpl first;
+        public CoreValue first;
 
         /**
          * Whether values that match the first should be returned.
@@ -117,7 +117,7 @@ public class Filter {
         /**
          * The last value to read, or null to read until the end.
          */
-        public ScalarImpl last;
+        public CoreValue last;
 
         /**
          * Whether values that match the last should be returned.
@@ -229,14 +229,14 @@ public class Filter {
         }
     }
 
-    public void restrictProperty(String propertyName, Operator op, ScalarImpl value) {
+    public void restrictProperty(String propertyName, Operator op, CoreValue value) {
         PropertyRestriction x = propertyRestrictions.get(propertyName);
         if (x == null) {
             x = new PropertyRestriction();
             x.propertyName = propertyName;
             propertyRestrictions.put(propertyName, x);
         }
-        ScalarImpl oldFirst = x.first, oldLast = x.last;
+        CoreValue oldFirst = x.first, oldLast = x.last;
         switch (op) {
         case EQUAL:
             x.first = maxValue(oldFirst, value);
@@ -277,14 +277,14 @@ public class Filter {
         }
     }
 
-    static ScalarImpl maxValue(ScalarImpl a, ScalarImpl b) {
+    static CoreValue maxValue(CoreValue a, CoreValue b) {
         if (a == null) {
             return b;
         }
         return a.compareTo(b) < 0 ? b : a;
     }
 
-    static ScalarImpl minValue(ScalarImpl a, ScalarImpl b) {
+    static CoreValue minValue(CoreValue a, CoreValue b) {
         if (a == null) {
             return b;
         }

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/QueryTest.java Tue Mar 27 12:50:09 2012
@@ -64,7 +64,7 @@ public class QueryTest {
     @Test
     public void bindVariableTest() throws Exception {
         head = mk.commit("/", "+ \"test\": { \"hello\": {\"id\": \"1\"}, \"world\": {\"id\": \"2\"}}", null, null);
-        HashMap<String, ScalarImpl> sv = new HashMap<String, ScalarImpl>();
+        HashMap<String, CoreValue> sv = new HashMap<String, CoreValue>();
         ScalarFactory vf = new ScalarFactory();
         sv.put("id", vf.createValue("1"));
         Iterator<Row> result;
@@ -170,12 +170,12 @@ public class QueryTest {
 
     private String readRow(String query, Row row) {
         StringBuilder buff = new StringBuilder();
-        ScalarImpl[] values = row.getValues();
+        CoreValue[] values = row.getValues();
         for (int i = 0; i < values.length; i++) {
             if (i > 0) {
                 buff.append(", ");
             }
-            ScalarImpl v = values[i];
+            CoreValue v = values[i];
             buff.append(v == null ? "null" : v.getString());
         }
         return buff.toString();

Modified: jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java?rev=1305825&r1=1305824&r2=1305825&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java (original)
+++ jackrabbit/oak/trunk/oak-core/src/test/java/org/apache/jackrabbit/oak/query/index/FilterTest.java Tue Mar 27 12:50:09 2012
@@ -23,7 +23,7 @@ import static org.junit.Assert.assertTru
 import static org.junit.Assert.fail;
 import java.util.ArrayList;
 import java.util.Random;
-import org.apache.jackrabbit.oak.query.ScalarImpl;
+import org.apache.jackrabbit.oak.query.CoreValue;
 import org.apache.jackrabbit.oak.query.ScalarFactory;
 import org.apache.jackrabbit.oak.query.ast.Operator;
 import org.apache.jackrabbit.oak.query.index.Filter.PathRestriction;
@@ -36,8 +36,8 @@ public class FilterTest {
 
     @Test
     public void propertyRestriction() {
-        ScalarImpl one = new ScalarFactory().createValue("1");
-        ScalarImpl two = new ScalarFactory().createValue("2");
+        CoreValue one = new ScalarFactory().createValue("1");
+        CoreValue two = new ScalarFactory().createValue("2");
 
         Filter f = new Filter(null);
         assertTrue(null == f.getPropertyRestriction("x"));



Mime
View raw message