commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ggreg...@apache.org
Subject svn commit: r1073521 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java
Date Tue, 22 Feb 2011 21:46:27 GMT
Author: ggregory
Date: Tue Feb 22 21:46:27 2011
New Revision: 1073521

URL: http://svn.apache.org/viewvc?rev=1073521&view=rev
Log:
Better class names for internal buffers.

Modified:
    commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java

Modified: commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java
URL: http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java?rev=1073521&r1=1073520&r2=1073521&view=diff
==============================================================================
--- commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java
(original)
+++ commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java
Tue Feb 22 21:46:27 2011
@@ -208,9 +208,9 @@ public class ColognePhonetic implements 
         }
     }
 
-    private class CologneLeftBuffer extends CologneBuffer {
+    private class CologneOutputBuffer extends CologneBuffer {
 
-        public CologneLeftBuffer(int buffSize) {
+        public CologneOutputBuffer(int buffSize) {
             super(buffSize);
         }
 
@@ -226,9 +226,9 @@ public class ColognePhonetic implements 
         }
     }
 
-    private class CologneRightBuffer extends CologneBuffer {
+    private class CologneInputBuffer extends CologneBuffer {
 
-        public CologneRightBuffer(char[] data) {
+        public CologneInputBuffer(char[] data) {
             super(data);
         }
 
@@ -298,8 +298,8 @@ public class ColognePhonetic implements 
 
         text = preprocess(text);
 
-        CologneLeftBuffer left = new CologneLeftBuffer(text.length() * 2);
-        CologneRightBuffer right = new CologneRightBuffer(text.toCharArray());
+        CologneOutputBuffer output = new CologneOutputBuffer(text.length() * 2);
+        CologneInputBuffer input = new CologneInputBuffer(text.toCharArray());
 
         char nextChar;
 
@@ -308,13 +308,13 @@ public class ColognePhonetic implements 
         char code;
         char chr;
 
-        int rightLength = right.length();
+        int rightLength = input.length();
 
         while (rightLength > 0) {
-            chr = right.removeNext();
+            chr = input.removeNext();
 
-            if ((rightLength = right.length()) > 0) {
-                nextChar = right.getNextChar();
+            if ((rightLength = input.length()) > 0) {
+                nextChar = input.getNextChar();
             } else {
                 nextChar = '-';
             }
@@ -336,7 +336,7 @@ public class ColognePhonetic implements 
                 code = '4';
             } else if (chr == 'X' && !arrayContains(new char[] { 'C', 'K', 'Q' },
lastChar)) {
                 code = '4';
-                right.addLeft('S');
+                input.addLeft('S');
                 rightLength++;
             } else if (chr == 'S' || chr == 'Z') {
                 code = '8';
@@ -368,13 +368,13 @@ public class ColognePhonetic implements 
             }
 
             if (code != '-' && (lastCode != code && (code != '0' || lastCode
== '/') || code < '0' || code > '8')) {
-                left.addRight(code);
+                output.addRight(code);
             }
 
             lastChar = chr;
             lastCode = code;
         }
-        return left.toString();
+        return output.toString();
     }
 
     public Object encode(Object object) throws EncoderException {



Mime
View raw message