You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2011/01/25 21:21:27 UTC

svn commit: r1063438 - /commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/ColognePhonetic.java

Author: ggregory
Date: Tue Jan 25 20:21:27 2011
New Revision: 1063438

URL: http://svn.apache.org/viewvc?rev=1063438&view=rev
Log:
Sort methods AB.

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=1063438&r1=1063437&r2=1063438&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 Jan 25 20:21:27 2011
@@ -264,19 +264,16 @@ public class ColognePhonetic implements 
             new char[] { '\u00DF', 'S' }      // ß
     };
 
-    public Object encode(Object object) throws EncoderException {
-        if (!(object instanceof String)) {
-            throw new EncoderException(
-                    "This method’s parameter was expected to be of the type "
-                            + String.class.getName()
-                            + ". But actually it was of the type "
-                            + object.getClass().getName() + ".");
+    /*
+     * Returns whether the array contains the key, or not.
+     */
+    private static boolean arrayContains(char[] arr, char key) {
+        for (int i = 0; i < arr.length; i++) {
+            if (arr[i] == key) {
+                return true;
+            }
         }
-        return encode((String) object);
-    }
-
-    public String encode(String text) {
-        return colognePhonetic(text);
+        return false;
     }
 
     /**
@@ -385,16 +382,23 @@ public class ColognePhonetic implements 
         return left.toString();
     }
 
-    /*
-     * Returns whether the array contains the key, or not.
-     */
-    private static boolean arrayContains(char[] arr, char key) {
-        for (int i = 0; i < arr.length; i++) {
-            if (arr[i] == key) {
-                return true;
-            }
+    public Object encode(Object object) throws EncoderException {
+        if (!(object instanceof String)) {
+            throw new EncoderException(
+                    "This method’s parameter was expected to be of the type "
+                            + String.class.getName()
+                            + ". But actually it was of the type "
+                            + object.getClass().getName() + ".");
         }
-        return false;
+        return encode((String) object);
+    }
+
+    public String encode(String text) {
+        return colognePhonetic(text);
+    }
+
+    public boolean isCologneEqual(String text1, String text2) {
+        return colognePhonetic(text1).equals(colognePhonetic(text2));
     }
 
     /*
@@ -421,8 +425,4 @@ public class ColognePhonetic implements 
 
         return text;
     }
-
-    public boolean isCologneEqual(String text1, String text2) {
-        return colognePhonetic(text1).equals(colognePhonetic(text2));
-    }
 }