@@ -39,24 +39,31 @@ public class Caverphone implements StringEncoder {
39
39
*/
40
40
private final Caverphone2 encoder = new Caverphone2 ();
41
41
42
+ /**
43
+ * Constructs a new instance.
44
+ */
45
+ public Caverphone () {
46
+ // empty
47
+ }
48
+
42
49
/**
43
50
* Encodes the given String into a Caverphone value.
44
51
*
45
52
* @param source
46
53
* String the source string
47
- * @return A caverphone code for the given String
54
+ * @return A Caverphone code for the given String
48
55
*/
49
56
public String caverphone (final String source ) {
50
57
return this .encoder .encode (source );
51
58
}
52
59
53
60
/**
54
- * Encodes an Object using the caverphone algorithm. This method is provided in order to satisfy the requirements of
61
+ * Encodes an Object using the Caverphone algorithm. This method is provided in order to satisfy the requirements of
55
62
* the Encoder interface, and will throw an EncoderException if the supplied object is not of type {@link String}.
56
63
*
57
64
* @param obj
58
65
* Object to encode
59
- * @return An object (or type {@link String}) containing the caverphone code which corresponds to the String
66
+ * @return An object (or type {@link String}) containing the Caverphone code which corresponds to the String
60
67
* supplied.
61
68
* @throws EncoderException
62
69
* if the parameter supplied is not of type {@link String}.
@@ -74,21 +81,21 @@ public Object encode(final Object obj) throws EncoderException {
74
81
*
75
82
* @param str
76
83
* String object to encode
77
- * @return The caverphone code corresponding to the String supplied
84
+ * @return The Caverphone code corresponding to the String supplied
78
85
*/
79
86
@ Override
80
87
public String encode (final String str ) {
81
88
return caverphone (str );
82
89
}
83
90
84
91
/**
85
- * Tests if the caverphones of two strings are identical.
92
+ * Tests if the Caverphones of two strings are identical.
86
93
*
87
94
* @param str1
88
95
* First of two strings to compare
89
96
* @param str2
90
97
* Second of two strings to compare
91
- * @return {@code true} if the caverphones of these strings are identical, {@code false} otherwise.
98
+ * @return {@code true} if the Caverphones of these strings are identical, {@code false} otherwise.
92
99
*/
93
100
public boolean isCaverphoneEqual (final String str1 , final String str2 ) {
94
101
return caverphone (str1 ).equals (caverphone (str2 ));
0 commit comments