Skip to content

Commit ec31d79

Browse files
committed
eol-style
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1085238 13f79535-47bb-0310-9956-ffa450edef68
1 parent ba53374 commit ec31d79

9 files changed

Lines changed: 681 additions & 681 deletions

File tree

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,77 @@
1-
/*
2-
* Licensed to the Apache Software Foundation (ASF) under one or more
3-
* contributor license agreements. See the NOTICE file distributed with
4-
* this work for additional information regarding copyright ownership.
5-
* The ASF licenses this file to You under the Apache License, Version 2.0
6-
* (the "License"); you may not use this file except in compliance with
7-
* the License. You may obtain a copy of the License at
8-
*
9-
* http://www.apache.org/licenses/LICENSE-2.0
10-
*
11-
* Unless required by applicable law or agreed to in writing, software
12-
* distributed under the License is distributed on an "AS IS" BASIS,
13-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
* See the License for the specific language governing permissions and
15-
* limitations under the License.
16-
*/
17-
18-
package org.apache.commons.codec.language;
19-
20-
import org.apache.commons.codec.EncoderException;
21-
import org.apache.commons.codec.StringEncoder;
22-
23-
/**
24-
* Encodes a string into a Caverphone value.
25-
*
26-
* This is an algorithm created by the Caversham Project at the University of Otago. It implements the Caverphone 2.0
27-
* algorithm:
28-
*
29-
* @author Apache Software Foundation
30-
* @version $Id: Caverphone.java 1075947 2011-03-01 17:56:14Z ggregory $
31-
* @see <a href="http://en.wikipedia.org/wiki/Caverphone">Wikipedia - Caverphone</a>
32-
* @since 1.5
33-
*/
34-
public abstract class AbstractCaverphone implements StringEncoder {
35-
36-
/**
37-
* Creates an instance of the Caverphone encoder
38-
*/
39-
public AbstractCaverphone() {
40-
super();
41-
}
42-
43-
/**
44-
* Encodes an Object using the caverphone algorithm. This method is provided in order to satisfy the requirements of
45-
* the Encoder interface, and will throw an EncoderException if the supplied object is not of type java.lang.String.
46-
*
47-
* @param source
48-
* Object to encode
49-
* @return An object (or type java.lang.String) containing the caverphone code which corresponds to the String
50-
* supplied.
51-
* @throws EncoderException
52-
* if the parameter supplied is not of type java.lang.String
53-
*/
54-
public Object encode(Object source) throws EncoderException {
55-
if (!(source instanceof String)) {
56-
throw new EncoderException("Parameter supplied to Caverphone encode is not of type java.lang.String");
57-
}
58-
return this.encode((String) source);
59-
}
60-
61-
/**
62-
* Tests if the encodings of two strings are equal.
63-
*
64-
* This method might be promoted to a new AbstractStringEncoder superclass.
65-
*
66-
* @param str1
67-
* First of two strings to compare
68-
* @param str2
69-
* Second of two strings to compare
70-
* @return <code>true</code> if the encodings of these strings are identical, <code>false</code> otherwise.
71-
* @throws EncoderException
72-
*/
73-
public boolean isEncodeEqual(String str1, String str2) throws EncoderException {
74-
return this.encode(str1).equals(this.encode(str2));
75-
}
76-
77-
}
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one or more
3+
* contributor license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright ownership.
5+
* The ASF licenses this file to You under the Apache License, Version 2.0
6+
* (the "License"); you may not use this file except in compliance with
7+
* the License. You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
package org.apache.commons.codec.language;
19+
20+
import org.apache.commons.codec.EncoderException;
21+
import org.apache.commons.codec.StringEncoder;
22+
23+
/**
24+
* Encodes a string into a Caverphone value.
25+
*
26+
* This is an algorithm created by the Caversham Project at the University of Otago. It implements the Caverphone 2.0
27+
* algorithm:
28+
*
29+
* @author Apache Software Foundation
30+
* @version $Id: Caverphone.java 1075947 2011-03-01 17:56:14Z ggregory $
31+
* @see <a href="http://en.wikipedia.org/wiki/Caverphone">Wikipedia - Caverphone</a>
32+
* @since 1.5
33+
*/
34+
public abstract class AbstractCaverphone implements StringEncoder {
35+
36+
/**
37+
* Creates an instance of the Caverphone encoder
38+
*/
39+
public AbstractCaverphone() {
40+
super();
41+
}
42+
43+
/**
44+
* Encodes an Object using the caverphone algorithm. This method is provided in order to satisfy the requirements of
45+
* the Encoder interface, and will throw an EncoderException if the supplied object is not of type java.lang.String.
46+
*
47+
* @param source
48+
* Object to encode
49+
* @return An object (or type java.lang.String) containing the caverphone code which corresponds to the String
50+
* supplied.
51+
* @throws EncoderException
52+
* if the parameter supplied is not of type java.lang.String
53+
*/
54+
public Object encode(Object source) throws EncoderException {
55+
if (!(source instanceof String)) {
56+
throw new EncoderException("Parameter supplied to Caverphone encode is not of type java.lang.String");
57+
}
58+
return this.encode((String) source);
59+
}
60+
61+
/**
62+
* Tests if the encodings of two strings are equal.
63+
*
64+
* This method might be promoted to a new AbstractStringEncoder superclass.
65+
*
66+
* @param str1
67+
* First of two strings to compare
68+
* @param str2
69+
* Second of two strings to compare
70+
* @return <code>true</code> if the encodings of these strings are identical, <code>false</code> otherwise.
71+
* @throws EncoderException
72+
*/
73+
public boolean isEncodeEqual(String str1, String str2) throws EncoderException {
74+
return this.encode(str1).equals(this.encode(str2));
75+
}
76+
77+
}

0 commit comments

Comments
 (0)