public class PrefixMapExtended extends PrefixMapBase
PrefixMap
which extends another prefix map
without ever altering the parent.
This allows code to modify a prefix map based off of another map without modifying that original map. This is somewhat different than simply making a copy of an existing map since this implementation is partly a view over another map so will reflect changes that happen to the other map.
Constructor and Description |
---|
PrefixMapExtended(PrefixMap ext)
Creates an extended prefix map
|
Modifier and Type | Method and Description |
---|---|
Pair<String,String> |
abbrev(String uriStr)
Abbreviate an IRI and return a pair of prefix and local parts, or null.
|
String |
abbreviate(String uriStr)
Abbreviate an IRI or return null
|
void |
add(String prefix,
org.apache.jena.iri.IRI iri)
Add a prefix, overwrites any existing association
|
boolean |
contains(String prefix)
Gets whether the map contains a given prefix
|
void |
delete(String prefix)
Delete a prefix
|
String |
expand(String prefix,
String localName)
Expand a prefix, return null if it can't be expanded
|
Map<String,org.apache.jena.iri.IRI> |
getMapping()
Return the underlying mapping, this is generally unsafe to modify and
implementations may opt to return an unmodifiable view of the mapping if
they wish
|
boolean |
isEmpty()
return whether the
|
int |
size()
Return the number of entries in the prefix map.
|
add, expand, getMappingCopy, getMappingCopyStr, putAll, putAll, putAll, toString
public PrefixMapExtended(PrefixMap ext)
ext
- Prefix Map to extendpublic void add(String prefix, org.apache.jena.iri.IRI iri)
PrefixMap
prefix
- Prefixiri
- Namespace IRIpublic void delete(String prefix)
PrefixMap
prefix
- Prefix to deletepublic String expand(String prefix, String localName)
PrefixMap
prefix
- PrefixlocalName
- Local namepublic Map<String,org.apache.jena.iri.IRI> getMapping()
PrefixMap
public boolean contains(String prefix)
PrefixMap
prefix
- Prefixpublic String abbreviate(String uriStr)
PrefixMap
uriStr
- URI to abbreviatepublic Pair<String,String> abbrev(String uriStr)
PrefixMap
uriStr
- URI string to abbreviatePrefixMap.abbreviate(java.lang.String)
public boolean isEmpty()
PrefixMap
public int size()
PrefixMap
Licenced under the Apache License, Version 2.0