jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1303394 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak: api/Scalar.java query/Value.java
Date Wed, 21 Mar 2012 14:01:37 GMT
Author: jukka
Date: Wed Mar 21 14:01:36 2012
New Revision: 1303394

URL: http://svn.apache.org/viewvc?rev=1303394&view=rev
Log:
OAK-33: Values in oak-core

First draft of the Scalar interface

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Scalar.java
  (with props)
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Value.java

Added: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Scalar.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Scalar.java?rev=1303394&view=auto
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Scalar.java
(added)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Scalar.java
Wed Mar 21 14:01:36 2012
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.jackrabbit.oak.api;
+
+import java.io.InputStream;
+import java.math.BigDecimal;
+
+/**
+ * An immutable, typed scalar value.
+ */
+public interface Scalar {
+
+    /**
+     * Returns the value type.
+     * <p>
+     * TODO: Define value types
+     *
+     * @return value type
+     */
+    int getType();
+
+    boolean getBoolean();
+
+    long getLong();
+
+    double getDouble();
+
+    BigDecimal getDecimal();
+
+    InputStream getInputStream();
+
+    String getString();
+
+}

Propchange: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/api/Scalar.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Value.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Value.java?rev=1303394&r1=1303393&r2=1303394&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Value.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/query/Value.java
Wed Mar 21 14:01:36 2012
@@ -16,9 +16,12 @@
  */
 package org.apache.jackrabbit.oak.query;
 
+import java.io.InputStream;
 import java.math.BigDecimal;
 
-public class Value implements Comparable<Value> {
+import org.apache.jackrabbit.oak.api.Scalar;
+
+public class Value implements Scalar, Comparable<Value> {
 
     private final Object value;
     private final int type;
@@ -61,6 +64,10 @@ public class Value implements Comparable
         return value.toString();
     }
 
+    public InputStream getInputStream() {
+        throw new UnsupportedOperationException(); // TODO
+    }
+
     public String getDate() {
         // TODO convert?
         return value.toString();



Mime
View raw message