jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1330790 - in /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core: RootImpl.java TreeImpl.java TreeImpl2.java
Date Thu, 26 Apr 2012 11:45:20 GMT
Author: mduerig
Date: Thu Apr 26 11:45:20 2012
New Revision: 1330790

URL: http://svn.apache.org/viewvc?rev=1330790&view=rev
Log:
OAK-18: Define Oak API
- replace old TreeImpl with new implementation

Added:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
      - copied, changed from r1330787, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java
Removed:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java
Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java?rev=1330790&r1=1330789&r2=1330790&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/RootImpl.java
Thu Apr 26 11:45:20 2012
@@ -22,7 +22,7 @@ import org.apache.jackrabbit.oak.api.Com
 import org.apache.jackrabbit.oak.api.CoreValue;
 import org.apache.jackrabbit.oak.api.Root;
 import org.apache.jackrabbit.oak.api.Tree;
-import org.apache.jackrabbit.oak.core.TreeImpl2.Listener;
+import org.apache.jackrabbit.oak.core.TreeImpl.Listener;
 import org.apache.jackrabbit.oak.kernel.NodeState;
 import org.apache.jackrabbit.oak.kernel.NodeStateBuilder;
 import org.apache.jackrabbit.oak.kernel.NodeStore;
@@ -49,7 +49,7 @@ public class RootImpl implements Root {
     private NodeState base;
 
     /** Root state of this tree */
-    private TreeImpl2 root;
+    private TreeImpl root;
 
     /** Listener for changes on the content tree */
     private TreeListener treeListener = new TreeListener();
@@ -61,17 +61,17 @@ public class RootImpl implements Root {
         this.workspaceName = workspaceName;
         this.base = store.getRoot().getChildNode(workspaceName);
         nodeStateBuilder = store.getBuilder(base);
-        this.root = new TreeImpl2(store, nodeStateBuilder, treeListener);
+        this.root = new TreeImpl(store, nodeStateBuilder, treeListener);
     }
 
     @Override
     public boolean move(String sourcePath, String destPath) {
-        TreeImpl2 source = getTransientState(sourcePath);
+        TreeImpl source = getTransientState(sourcePath);
         if (source == null) {
             return false;
         }
 
-        TreeImpl2 destParent = getTransientState(getParentPath(destPath));
+        TreeImpl destParent = getTransientState(getParentPath(destPath));
         String destName = getName(destPath);
         return destParent != null && source.move(destParent, destName);
 
@@ -79,12 +79,12 @@ public class RootImpl implements Root {
 
     @Override
     public boolean copy(String sourcePath, String destPath) {
-        TreeImpl2 sourceNode = getTransientState(sourcePath);
+        TreeImpl sourceNode = getTransientState(sourcePath);
         if (sourceNode == null) {
             return false;
         }
 
-        TreeImpl2 destParent = getTransientState(getParentPath(destPath));
+        TreeImpl destParent = getTransientState(getParentPath(destPath));
         String destName = getName(destPath);
         return destParent != null && sourceNode.copy(destParent, destName);
 
@@ -106,7 +106,7 @@ public class RootImpl implements Root {
         base = store.getRoot().getChildNode(workspaceName);
         nodeStateBuilder = store.getBuilder(base);
         treeListener = new TreeListener();
-        root = new TreeImpl2(store, nodeStateBuilder, treeListener);
+        root = new TreeImpl(store, nodeStateBuilder, treeListener);
     }
 
     @Override
@@ -123,8 +123,8 @@ public class RootImpl implements Root {
      * @return  a {@link Tree} instance for the item
      *          at {@code path} or {@code null} if no such item exits.
      */
-    private TreeImpl2 getTransientState(String path) {
-        TreeImpl2 state = root;
+    private TreeImpl getTransientState(String path) {
+        TreeImpl state = root;
         for (String name : elements(path)) {
             state = state.getChild(name);
             if (state == null) {
@@ -139,37 +139,37 @@ public class RootImpl implements Root {
         private boolean isDirty;
 
         @Override
-        public void addChild(TreeImpl2 tree, String name) {
+        public void addChild(TreeImpl tree, String name) {
             isDirty = true;
         }
 
         @Override
-        public void removeChild(TreeImpl2 tree, String name) {
+        public void removeChild(TreeImpl tree, String name) {
             isDirty = true;
         }
 
         @Override
-        public void setProperty(TreeImpl2 tree, String name, CoreValue value) {
+        public void setProperty(TreeImpl tree, String name, CoreValue value) {
             isDirty = true;
         }
 
         @Override
-        public void setProperty(TreeImpl2 tree, String name, List<CoreValue> values)
{
+        public void setProperty(TreeImpl tree, String name, List<CoreValue> values)
{
             isDirty = true;
         }
 
         @Override
-        public void removeProperty(TreeImpl2 tree, String name) {
+        public void removeProperty(TreeImpl tree, String name) {
             isDirty = true;
         }
 
         @Override
-        public void move(TreeImpl2 tree, String name, TreeImpl2 moved) {
+        public void move(TreeImpl tree, String name, TreeImpl moved) {
             isDirty = true;
         }
 
         @Override
-        public void copy(TreeImpl2 tree, String name, TreeImpl2 copied) {
+        public void copy(TreeImpl tree, String name, TreeImpl copied) {
             isDirty = true;
         }
 

Copied: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
(from r1330787, jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java)
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java?p2=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java&p1=jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java&r1=1330787&r2=1330790&rev=1330790&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl2.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/core/TreeImpl.java
Thu Apr 26 11:45:20 2012
@@ -35,7 +35,7 @@ import java.util.List;
 
 import static org.apache.jackrabbit.oak.util.Iterators.flatten;
 
-public class TreeImpl2 implements Tree {
+public class TreeImpl implements Tree {
 
     private final NodeStore store;
 
@@ -54,10 +54,10 @@ public class TreeImpl2 implements Tree {
     private String name;
 
     /** Parent of this content tree */
-    private TreeImpl2 parent;
+    private TreeImpl parent;
 
-    private TreeImpl2(NodeStore store, NodeState baseState, NodeStateBuilder builder,
-                      TreeImpl2 parent, String name, Listener listener) {
+    private TreeImpl(NodeStore store, NodeState baseState, NodeStateBuilder builder,
+            TreeImpl parent, String name, Listener listener) {
 
         this.store = store;
         this.builder = builder;
@@ -67,7 +67,7 @@ public class TreeImpl2 implements Tree {
         this.parent = parent;
     }
     
-    TreeImpl2(NodeStore store, NodeStateBuilder nodeStateBuilder, Listener listener) {
+    TreeImpl(NodeStore store, NodeStateBuilder nodeStateBuilder, Listener listener) {
         this(store, nodeStateBuilder.getNodeState(), nodeStateBuilder, null, "", listener);
     }
 
@@ -81,14 +81,14 @@ public class TreeImpl2 implements Tree {
          * @param tree  parent to which a child was added
          * @param name  name of the added child
          */
-        void addChild(TreeImpl2 tree, String name);
+        void addChild(TreeImpl tree, String name);
 
         /**
          * The child of the given {@code name} has been removed from {@code tree}
          * @param tree  parent from which a child was removed
          * @param name  name of the removed child
          */
-        void removeChild(TreeImpl2 tree, String name);
+        void removeChild(TreeImpl tree, String name);
 
         /**
          * The property of the given {@code name} and {@code value} has been set.
@@ -96,7 +96,7 @@ public class TreeImpl2 implements Tree {
          * @param name  name of the property
          * @param value  value of the property
          */
-        void setProperty(TreeImpl2 tree, String name, CoreValue value);
+        void setProperty(TreeImpl tree, String name, CoreValue value);
 
         /**
          * The property of the given {@code name} and {@code values} has been set.
@@ -104,14 +104,14 @@ public class TreeImpl2 implements Tree {
          * @param name  name of the property
          * @param values  values of the property
          */
-        void setProperty(TreeImpl2 tree, String name, List<CoreValue> values);
+        void setProperty(TreeImpl tree, String name, List<CoreValue> values);
 
         /**
          * The property of the given {@code name} has been removed.
          * @param tree  parent on which the property was removed.
          * @param name  name of the property
          */
-        void removeProperty(TreeImpl2 tree, String name);
+        void removeProperty(TreeImpl tree, String name);
 
         /**
          * The child with the given {@code name} has been moved.
@@ -119,7 +119,7 @@ public class TreeImpl2 implements Tree {
          * @param name  name of the moved child
          * @param moved  moved child
          */
-        void move(TreeImpl2 tree, String name, TreeImpl2 moved);
+        void move(TreeImpl tree, String name, TreeImpl moved);
 
         /**
          * The child with the given {@code name} been copied.
@@ -127,7 +127,7 @@ public class TreeImpl2 implements Tree {
          * @param name  name of the copied child
          * @param copied  copied child
          */
-        void copy(TreeImpl2 tree, String name, TreeImpl2 copied);
+        void copy(TreeImpl tree, String name, TreeImpl copied);
     }
 
     @Override
@@ -211,7 +211,7 @@ public class TreeImpl2 implements Tree {
     }
 
     @Override
-    public TreeImpl2 getChild(String name) {
+    public TreeImpl getChild(String name) {
         NodeStateBuilder childBuilder = builder.getChildBuilder(name);
         NodeState childBaseState = baseState == null
             ? null
@@ -219,7 +219,7 @@ public class TreeImpl2 implements Tree {
 
         return childBuilder == null
             ? null
-            : new TreeImpl2(store, childBaseState, childBuilder, this, name, listener);
+            : new TreeImpl(store, childBaseState, childBuilder, this, name, listener);
     }
 
     @Override
@@ -285,7 +285,7 @@ public class TreeImpl2 implements Tree {
                     @Override
                     public Tree apply(ChildNodeEntry entry) {
                         NodeStateBuilder childBuilder = builder.getChildBuilder(entry.getName());
-                        return new TreeImpl2(store, childBuilder.getNodeState(), childBuilder,
TreeImpl2.this, entry.getName(), listener);
+                        return new TreeImpl(store, childBuilder.getNodeState(), childBuilder,
TreeImpl.this, entry.getName(), listener);
                     }
                 });
             }
@@ -295,7 +295,7 @@ public class TreeImpl2 implements Tree {
     @Override
     public Tree addChild(String name) {
         builder.addNode(name);
-        TreeImpl2 added = getChild(name);
+        TreeImpl added = getChild(name);
         if (added != null) {
             listener.addChild(added, name);
         }
@@ -344,10 +344,10 @@ public class TreeImpl2 implements Tree {
      * @return  {@code true} if successful, {@code false otherwise}. I.e.
      * when {@code destName} already exists at {@code destParent}
      */
-    public boolean move(TreeImpl2 destParent, String destName) {
+    public boolean move(TreeImpl destParent, String destName) {
         boolean result = builder.moveTo(destParent.builder, destName);
         if (result) {
-            TreeImpl2 oldParent = parent;
+            TreeImpl oldParent = parent;
             String oldName = name;
 
             name = destName;
@@ -368,7 +368,7 @@ public class TreeImpl2 implements Tree {
      * @return  {@code true} if successful, {@code false otherwise}. I.e.
      * when {@code destName} already exists at {@code destParent}
      */
-    public boolean copy(TreeImpl2 destParent, String destName) {
+    public boolean copy(TreeImpl destParent, String destName) {
         boolean result = builder.copyTo(destParent.builder, destName);
         if (result) {
             if (listener != null) {



Mime
View raw message