All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sf.saxon.lib.FeatureIndex Maven / Gradle / Ivy

There is a newer version: 12.5
Show newest version
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);
    }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy