varargs
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/lang/trunk@1091095 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
93666dd2f2
commit
77c0ffce3c
|
@ -37,18 +37,20 @@ public class LookupTranslator extends CharSequenceTranslator {
|
||||||
*
|
*
|
||||||
* @param lookup CharSequence[][] table of size [*][2]
|
* @param lookup CharSequence[][] table of size [*][2]
|
||||||
*/
|
*/
|
||||||
public LookupTranslator(CharSequence[][] lookup) {
|
public LookupTranslator(CharSequence[]... lookup) {
|
||||||
lookupMap = new HashMap<CharSequence, CharSequence>();
|
lookupMap = new HashMap<CharSequence, CharSequence>();
|
||||||
int _shortest = Integer.MAX_VALUE;
|
int _shortest = Integer.MAX_VALUE;
|
||||||
int _longest = 0;
|
int _longest = 0;
|
||||||
for(CharSequence[] seq : lookup) {
|
if (lookup != null) {
|
||||||
this.lookupMap.put(seq[0], seq[1]);
|
for (CharSequence[] seq : lookup) {
|
||||||
int sz = seq[0].length();
|
this.lookupMap.put(seq[0], seq[1]);
|
||||||
if(sz < _shortest) {
|
int sz = seq[0].length();
|
||||||
_shortest = sz;
|
if(sz < _shortest) {
|
||||||
}
|
_shortest = sz;
|
||||||
if(sz > _longest) {
|
}
|
||||||
_longest = sz;
|
if(sz > _longest) {
|
||||||
|
_longest = sz;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
shortest = _shortest;
|
shortest = _shortest;
|
||||||
|
|
Loading…
Reference in New Issue