commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t.@apache.org
Subject svn commit: r1477274 - in /commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence: DeleteCommand.java EditCommand.java InsertCommand.java KeepCommand.java
Date Mon, 29 Apr 2013 19:12:30 GMT
Author: tn
Date: Mon Apr 29 19:12:29 2013
New Revision: 1477274

URL: http://svn.apache.org/r1477274
Log:
Make field private and provide a getter.

Modified:
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/DeleteCommand.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/EditCommand.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/InsertCommand.java
    commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/KeepCommand.java

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/DeleteCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/DeleteCommand.java?rev=1477274&r1=1477273&r2=1477274&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/DeleteCommand.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/DeleteCommand.java
Mon Apr 29 19:12:29 2013
@@ -50,6 +50,6 @@ public class DeleteCommand<T> extends Ed
      */    
     @Override
     public void accept(final CommandVisitor<T> visitor) {
-        visitor.visitDeleteCommand(object);
+        visitor.visitDeleteCommand(getObject());
     }    
 }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/EditCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/EditCommand.java?rev=1477274&r1=1477273&r2=1477274&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/EditCommand.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/EditCommand.java
Mon Apr 29 19:12:29 2013
@@ -47,6 +47,9 @@ package org.apache.commons.collections4.
  */
 public abstract class EditCommand<T> {
 
+    /** Object on which the command should be applied. */
+    private T object;
+
     /**
      * Simple constructor. Creates a new instance of EditCommand
      * 
@@ -58,6 +61,15 @@ public abstract class EditCommand<T> {
     }
 
     /**
+     * Returns the object associated with this command.
+     *
+     * @return the object on which the command is applied
+     */
+    protected T getObject() {
+        return object;
+    }
+
+    /**
      * Accept a visitor.
      * <p>
      * This method is invoked for each commands belonging to
@@ -67,7 +79,4 @@ public abstract class EditCommand<T> {
      */
     public abstract void accept(CommandVisitor<T> visitor);
 
-    /** Object on which the command should be applied. */
-    protected T object;
-
 }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/InsertCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/InsertCommand.java?rev=1477274&r1=1477273&r2=1477274&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/InsertCommand.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/InsertCommand.java
Mon Apr 29 19:12:29 2013
@@ -51,7 +51,7 @@ public class InsertCommand<T> extends Ed
      */
     @Override
     public void accept(final CommandVisitor<T> visitor) {
-        visitor.visitInsertCommand(object);
+        visitor.visitInsertCommand(getObject());
     }
 
 }

Modified: commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/KeepCommand.java
URL: http://svn.apache.org/viewvc/commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/KeepCommand.java?rev=1477274&r1=1477273&r2=1477274&view=diff
==============================================================================
--- commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/KeepCommand.java
(original)
+++ commons/proper/collections/trunk/src/main/java/org/apache/commons/collections4/comparators/sequence/KeepCommand.java
Mon Apr 29 19:12:29 2013
@@ -52,6 +52,6 @@ public class KeepCommand<T> extends Edit
      */
     @Override
     public void accept(final CommandVisitor<T> visitor) {
-        visitor.visitKeepCommand(object);
+        visitor.visitKeepCommand(getObject());
     }
 }



Mime
View raw message