java.lang.Object
dev.metaschema.core.qname.NamespaceCache
An integer-based cache of namespaces to reduce the memory footprint of
namespaces used by reusing instances with the same namespace.
-
Method Summary
Modifier and TypeMethodDescriptionget(int index) Lookup the namespace using the index value for an existing namespace.Lookup the index value for an existing namespace.getAsURI(int index) Lookup the namespace using the index value for an existing namespace.intGet the index value of the provided namespace.static NamespaceCacheinstance()Get the singleton instance.
-
Method Details
-
instance
Get the singleton instance.- Returns:
- the singleton instance
-
indexOf
Get the index value of the provided namespace.- Parameters:
namespace- the namespace- Returns:
- the index value
-
get
Lookup the index value for an existing namespace.- Parameters:
namespace- the namespace to lookup- Returns:
- an optional containing the index value, if it exists
-
get
Lookup the namespace using the index value for an existing namespace.- Parameters:
index- the index value to lookup- Returns:
- an optional containing the namespace, if the index value exists
-
getAsURI
Lookup the namespace using the index value for an existing namespace.- Parameters:
index- the index value to lookup- Returns:
- an optional containing the namespace as a URI, if the index value exists
-