whitespace (tabs to spaces)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1747822 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9aaa2bd51e
commit
52e866f4bc
@ -29,22 +29,22 @@ import org.apache.poi.ss.formula.functions.FreeRefFunction;
|
|||||||
* @author PUdalau
|
* @author PUdalau
|
||||||
*/
|
*/
|
||||||
public final class DefaultUDFFinder implements UDFFinder {
|
public final class DefaultUDFFinder implements UDFFinder {
|
||||||
private final Map<String, FreeRefFunction> _functionsByName;
|
private final Map<String, FreeRefFunction> _functionsByName;
|
||||||
|
|
||||||
public DefaultUDFFinder(String[] functionNames, FreeRefFunction[] functionImpls) {
|
public DefaultUDFFinder(String[] functionNames, FreeRefFunction[] functionImpls) {
|
||||||
int nFuncs = functionNames.length;
|
int nFuncs = functionNames.length;
|
||||||
if (functionImpls.length != nFuncs) {
|
if (functionImpls.length != nFuncs) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"Mismatch in number of function names and implementations");
|
"Mismatch in number of function names and implementations");
|
||||||
}
|
}
|
||||||
HashMap<String, FreeRefFunction> m = new HashMap<String, FreeRefFunction>(nFuncs * 3 / 2);
|
HashMap<String, FreeRefFunction> m = new HashMap<String, FreeRefFunction>(nFuncs * 3 / 2);
|
||||||
for (int i = 0; i < functionImpls.length; i++) {
|
for (int i = 0; i < functionImpls.length; i++) {
|
||||||
m.put(functionNames[i].toUpperCase(Locale.ROOT), functionImpls[i]);
|
m.put(functionNames[i].toUpperCase(Locale.ROOT), functionImpls[i]);
|
||||||
}
|
}
|
||||||
_functionsByName = m;
|
_functionsByName = m;
|
||||||
}
|
}
|
||||||
|
|
||||||
public FreeRefFunction findFunction(String name) {
|
public FreeRefFunction findFunction(String name) {
|
||||||
return _functionsByName.get(name.toUpperCase(Locale.ROOT));
|
return _functionsByName.get(name.toUpperCase(Locale.ROOT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user