net.sf.saxon.lib.FeatureIndex Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of Saxon-HE Show documentation
Show all versions of Saxon-HE Show documentation
The XSLT and XQuery Processor
package net.sf.saxon.lib;
import net.sf.saxon.z.IntHashMap;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeSet;
public class FeatureIndex {
private final static Map byName = new HashMap<>();
private final static IntHashMap byCode = new IntHashMap<>();
public static Iterable getNames() {
return new TreeSet(byName.keySet());
}
static {
FeatureData.init();
for (FeatureData data : FeatureData.featureList) {
byName.put(data.uri, data);
byCode.put(data.code, data);
}
}
public static boolean exists(String featureName) {
return byName.containsKey(featureName);
}
public static FeatureData getData(String featureName) {
return byName.get(featureName);
}
public static FeatureData getData(int code) {
return byCode.get(code);
}
}