You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@apache.org on 2005/08/09 00:05:25 UTC

svn commit: r230912 - /jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java

Author: scolebourne
Date: Mon Aug  8 15:05:19 2005
New Revision: 230912

URL: http://svn.apache.org/viewcvs?rev=230912&view=rev
Log:
Move reverse method in file to be with other methods returning this

Modified:
    jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java

Modified: jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java?rev=230912&r1=230911&r2=230912&view=diff
==============================================================================
--- jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java (original)
+++ jakarta/commons/proper/lang/trunk/src/java/org/apache/commons/lang/text/StrBuilder.java Mon Aug  8 15:05:19 2005
@@ -1194,6 +1194,26 @@
 
     //-----------------------------------------------------------------------
     /**
+     * Reverses the string builder placing each character in the opposite index.
+     * 
+     * @return this, to enable chaining
+     */
+    public StrBuilder reverse() {
+        if (size == 0) {
+            return this;
+        }
+        
+        int half = size / 2;
+        for (int leftIdx = 0, rightIdx = size - 1; leftIdx < half; leftIdx++,rightIdx--) {
+            char swap = buffer[leftIdx];
+            buffer[leftIdx] = buffer[rightIdx];
+            buffer[rightIdx] = swap;
+        }
+        return this;
+    }
+
+    //-----------------------------------------------------------------------
+    /**
      * Checks whether this builder starts with the specified string.
      * <p>
      * Note that this method handles null input quietly, unlike String.
@@ -1538,25 +1558,6 @@
             return startIndex;
         }
         return -1;
-    }
-
-    /**
-     * Reverses the string builder placing each character in the opposite index.
-     * 
-     * @return this, to enable chaining
-     */
-    public StrBuilder reverse() {
-        if (size == 0) {
-            return this;
-        }
-        
-        int half = size / 2;
-        for (int leftIdx = 0, rightIdx = size - 1; leftIdx < half; leftIdx++,rightIdx--) {
-            char swap = buffer[leftIdx];
-            buffer[leftIdx] = buffer[rightIdx];
-            buffer[rightIdx] = swap;
-        }
-        return this;
     }
 
     //-----------------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org