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,11 +37,12 @@ public class LookupTranslator extends CharSequenceTranslator {
|
|||
*
|
||||
* @param lookup CharSequence[][] table of size [*][2]
|
||||
*/
|
||||
public LookupTranslator(CharSequence[][] lookup) {
|
||||
public LookupTranslator(CharSequence[]... lookup) {
|
||||
lookupMap = new HashMap<CharSequence, CharSequence>();
|
||||
int _shortest = Integer.MAX_VALUE;
|
||||
int _longest = 0;
|
||||
for(CharSequence[] seq : lookup) {
|
||||
if (lookup != null) {
|
||||
for (CharSequence[] seq : lookup) {
|
||||
this.lookupMap.put(seq[0], seq[1]);
|
||||
int sz = seq[0].length();
|
||||
if(sz < _shortest) {
|
||||
|
@ -51,6 +52,7 @@ public class LookupTranslator extends CharSequenceTranslator {
|
|||
_longest = sz;
|
||||
}
|
||||
}
|
||||
}
|
||||
shortest = _shortest;
|
||||
longest = _longest;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue