jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1394788 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/
Date Fri, 05 Oct 2012 20:31:13 GMT
Author: mduerig
Date: Fri Oct  5 20:31:13 2012
New Revision: 1394788

URL: http://svn.apache.org/viewvc?rev=1394788&view=rev
Log:
OAK-350: Unify PropertyState and CoreValue
- pull up values to common base class

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java?rev=1394788&r1=1394787&r2=1394788&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BinariesPropertyState.java
Fri Oct  5 20:31:13 2012
@@ -25,12 +25,10 @@ import org.apache.jackrabbit.oak.api.Typ
 
 import static org.apache.jackrabbit.oak.api.Type.BINARIES;
 
-public class BinariesPropertyState extends MultiPropertyState {
-    private final List<Blob> values;
+public class BinariesPropertyState extends MultiPropertyState<Blob> {
 
     protected BinariesPropertyState(String name, List<Blob> values) {
-        super(name);
-        this.values = values;
+        super(name, values);
     }
 
     @Override
@@ -59,11 +57,6 @@ public class BinariesPropertyState exten
     }
 
     @Override
-    public int count() {
-        return values.size();
-    }
-
-    @Override
     public Type<?> getType() {
         return BINARIES;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java?rev=1394788&r1=1394787&r2=1394788&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/BooleansPropertyState.java
Fri Oct  5 20:31:13 2012
@@ -24,12 +24,9 @@ import org.apache.jackrabbit.oak.api.Typ
 
 import static org.apache.jackrabbit.oak.api.Type.BOOLEANS;
 
-public class BooleansPropertyState extends MultiPropertyState {
-    private final List<Boolean> values;
-
+public class BooleansPropertyState extends MultiPropertyState<Boolean> {
     protected BooleansPropertyState(String name, List<Boolean> values) {
-        super(name);
-        this.values = values;
+        super(name, values);
     }
 
     @Override
@@ -58,11 +55,6 @@ public class BooleansPropertyState exten
     }
 
     @Override
-    public int count() {
-        return values.size();
-    }
-
-    @Override
     public Type<?> getType() {
         return BOOLEANS;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java?rev=1394788&r1=1394787&r2=1394788&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DecimalsPropertyState.java
Fri Oct  5 20:31:13 2012
@@ -25,12 +25,10 @@ import org.apache.jackrabbit.oak.api.Typ
 
 import static org.apache.jackrabbit.oak.api.Type.DECIMALS;
 
-public class DecimalsPropertyState extends MultiPropertyState {
-    private final List<BigDecimal> values;
+public class DecimalsPropertyState extends MultiPropertyState<BigDecimal> {
 
     protected DecimalsPropertyState(String name, List<BigDecimal> values) {
-        super(name);
-        this.values = values;
+        super(name, values);
     }
 
     @Override
@@ -89,11 +87,6 @@ public class DecimalsPropertyState exten
     }
 
     @Override
-    public int count() {
-        return values.size();
-    }
-
-    @Override
     public Type<?> getType() {
         return DECIMALS;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java?rev=1394788&r1=1394787&r2=1394788&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/DoublesPropertyState.java
Fri Oct  5 20:31:13 2012
@@ -27,12 +27,9 @@ import org.apache.jackrabbit.oak.api.Typ
 
 import static org.apache.jackrabbit.oak.api.Type.DOUBLES;
 
-public class DoublesPropertyState extends MultiPropertyState {
-    private final List<Double> values;
-
+public class DoublesPropertyState extends MultiPropertyState<Double> {
     protected DoublesPropertyState(String name, List<Double>values) {
-        super(name);
-        this.values = values;
+        super(name, values);
     }
 
     @Override
@@ -91,11 +88,6 @@ public class DoublesPropertyState extend
     }
 
     @Override
-    public int count() {
-        return values.size();
-    }
-
-    @Override
     public Type<?> getType() {
         return DOUBLES;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java?rev=1394788&r1=1394787&r2=1394788&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/GenericsPropertyState.java
Fri Oct  5 20:31:13 2012
@@ -24,14 +24,12 @@ import org.apache.jackrabbit.oak.api.Typ
 
 import static com.google.common.base.Preconditions.checkArgument;
 
-public class GenericsPropertyState extends MultiPropertyState {
-    private final List<String> values;
+public class GenericsPropertyState extends MultiPropertyState<String> {
     private final Type<?> type;
 
     protected GenericsPropertyState(String name, List<String> values, Type<?>
type) {
-        super(name);
+        super(name, values);
         checkArgument(type.isArray());
-        this.values = values;
         this.type = type;
     }
 
@@ -46,11 +44,6 @@ public class GenericsPropertyState exten
     }
 
     @Override
-    public int count() {
-        return values.size();
-    }
-
-    @Override
     public Type<?> getType() {
         return type;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java?rev=1394788&r1=1394787&r2=1394788&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/LongsPropertyState.java
Fri Oct  5 20:31:13 2012
@@ -27,12 +27,10 @@ import org.apache.jackrabbit.oak.api.Typ
 
 import static org.apache.jackrabbit.oak.api.Type.LONGS;
 
-public class LongsPropertyState extends MultiPropertyState {
-    private final List<Long> values;
+public class LongsPropertyState extends MultiPropertyState<Long> {
 
     protected LongsPropertyState(String name, List<Long> values) {
-        super(name);
-        this.values = values;
+        super(name, values);
     }
 
     @Override
@@ -91,11 +89,6 @@ public class LongsPropertyState extends 
     }
 
     @Override
-    public int count() {
-        return values.size();
-    }
-
-    @Override
     public Type<?> getType() {
         return LONGS;
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java?rev=1394788&r1=1394787&r2=1394788&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MultiPropertyState.java
Fri Oct  5 20:31:13 2012
@@ -19,6 +19,7 @@
 package org.apache.jackrabbit.oak.plugins.memory;
 
 import java.math.BigDecimal;
+import java.util.List;
 
 import javax.annotation.Nonnull;
 import javax.jcr.PropertyType;
@@ -28,9 +29,12 @@ import com.google.common.collect.Iterabl
 import org.apache.jackrabbit.oak.api.Blob;
 import org.apache.jackrabbit.oak.api.Type;
 
-abstract class MultiPropertyState extends EmptyPropertyState {
-    protected MultiPropertyState(String name) {
+abstract class MultiPropertyState<T> extends EmptyPropertyState {
+    protected final List<T> values;
+
+    protected MultiPropertyState(String name, List<T> values) {
         super(name);
+        this.values = values;
     }
 
     protected abstract Iterable<String> getStrings();
@@ -150,6 +154,11 @@ abstract class MultiPropertyState extend
     }
 
     @Override
+    public final int count() {
+        return values.size();
+    }
+
+    @Override
     public long size(int index) {
         return getString(index).length();
     }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java?rev=1394788&r1=1394787&r2=1394788&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/memory/StringsPropertyState.java
Fri Oct  5 20:31:13 2012
@@ -24,12 +24,9 @@ import com.google.common.base.Function;
 import com.google.common.collect.Iterables;
 import org.apache.jackrabbit.oak.api.Type;
 
-public class StringsPropertyState extends MultiPropertyState {
-    private final List<String> values;
-
+public class StringsPropertyState extends MultiPropertyState<String> {
     protected StringsPropertyState(String name, List<String> values) {
-        super(name);
-        this.values = values;
+        super(name, values);
     }
 
     @Override
@@ -58,11 +55,6 @@ public class StringsPropertyState extend
     }
 
     @Override
-    public int count() {
-        return values.size();
-    }
-
-    @Override
     public Type<?> getType() {
         return Type.STRINGS;
     }



Mime
View raw message