first commit
This commit is contained in:
40
hrmsEjb/jxl/biff/formula/FunctionNames.java
Normal file
40
hrmsEjb/jxl/biff/formula/FunctionNames.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package jxl.biff.formula;
|
||||
|
||||
import common.Logger;
|
||||
import java.util.HashMap;
|
||||
import java.util.Locale;
|
||||
import java.util.ResourceBundle;
|
||||
|
||||
public class FunctionNames {
|
||||
private static Logger logger = Logger.getLogger(FunctionNames.class);
|
||||
|
||||
private HashMap names;
|
||||
|
||||
private HashMap functions;
|
||||
|
||||
public FunctionNames(Locale l) {
|
||||
ResourceBundle rb = ResourceBundle.getBundle("functions", l);
|
||||
this.names = new HashMap(Function.functions.length);
|
||||
this.functions = new HashMap(Function.functions.length);
|
||||
Function f = null;
|
||||
String n = null;
|
||||
String propname = null;
|
||||
for (int i = 0; i < Function.functions.length; i++) {
|
||||
f = Function.functions[i];
|
||||
propname = f.getPropertyName();
|
||||
n = (propname.length() != 0) ? rb.getString(propname) : null;
|
||||
if (n != null) {
|
||||
this.names.put(f, n);
|
||||
this.functions.put(n, f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Function getFunction(String s) {
|
||||
return (Function)this.functions.get(s);
|
||||
}
|
||||
|
||||
String getName(Function f) {
|
||||
return (String)this.names.get(f);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user