Skip to content

Commit 6e883fa

Browse files
committed
Sort methods AB.
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1063438 13f79535-47bb-0310-9956-ffa450edef68
1 parent 0582892 commit 6e883fa

1 file changed

Lines changed: 25 additions & 25 deletions

File tree

src/java/org/apache/commons/codec/language/ColognePhonetic.java

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -264,19 +264,16 @@ public char removeNext() {
264264
new char[] { '\u00DF', 'S' } // ß
265265
};
266266

267-
public Object encode(Object object) throws EncoderException {
268-
if (!(object instanceof String)) {
269-
throw new EncoderException(
270-
"This method’s parameter was expected to be of the type "
271-
+ String.class.getName()
272-
+ ". But actually it was of the type "
273-
+ object.getClass().getName() + ".");
267+
/*
268+
* Returns whether the array contains the key, or not.
269+
*/
270+
private static boolean arrayContains(char[] arr, char key) {
271+
for (int i = 0; i < arr.length; i++) {
272+
if (arr[i] == key) {
273+
return true;
274+
}
274275
}
275-
return encode((String) object);
276-
}
277-
278-
public String encode(String text) {
279-
return colognePhonetic(text);
276+
return false;
280277
}
281278

282279
/**
@@ -385,16 +382,23 @@ public String colognePhonetic(String text) {
385382
return left.toString();
386383
}
387384

388-
/*
389-
* Returns whether the array contains the key, or not.
390-
*/
391-
private static boolean arrayContains(char[] arr, char key) {
392-
for (int i = 0; i < arr.length; i++) {
393-
if (arr[i] == key) {
394-
return true;
395-
}
385+
public Object encode(Object object) throws EncoderException {
386+
if (!(object instanceof String)) {
387+
throw new EncoderException(
388+
"This method’s parameter was expected to be of the type "
389+
+ String.class.getName()
390+
+ ". But actually it was of the type "
391+
+ object.getClass().getName() + ".");
396392
}
397-
return false;
393+
return encode((String) object);
394+
}
395+
396+
public String encode(String text) {
397+
return colognePhonetic(text);
398+
}
399+
400+
public boolean isCologneEqual(String text1, String text2) {
401+
return colognePhonetic(text1).equals(colognePhonetic(text2));
398402
}
399403

400404
/*
@@ -421,8 +425,4 @@ private String preprocess(String text) {
421425

422426
return text;
423427
}
424-
425-
public boolean isCologneEqual(String text1, String text2) {
426-
return colognePhonetic(text1).equals(colognePhonetic(text2));
427-
}
428428
}

0 commit comments

Comments
 (0)