org.apache.jena.riot.system
Class PrefixMapExtended

java.lang.Object
  extended by org.apache.jena.riot.system.PrefixMapBase
      extended by org.apache.jena.riot.system.PrefixMapExtended
All Implemented Interfaces:
PrefixMap

public class PrefixMapExtended
extends PrefixMapBase

Implementation of a 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 Summary
PrefixMapExtended(PrefixMap ext)
          Creates an extended prefix map
 
Method Summary
 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.
 
Methods inherited from class org.apache.jena.riot.system.PrefixMapBase
add, expand, getMappingCopy, getMappingCopyStr, putAll, putAll, putAll, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrefixMapExtended

public PrefixMapExtended(PrefixMap ext)
Creates an extended prefix map

Parameters:
ext - Prefix Map to extend
Method Detail

add

public void add(String prefix,
                org.apache.jena.iri.IRI iri)
Description copied from interface: PrefixMap
Add a prefix, overwrites any existing association

Parameters:
prefix - Prefix
iri - Namespace IRI

delete

public void delete(String prefix)
Description copied from interface: PrefixMap
Delete a prefix

Parameters:
prefix - Prefix to delete

expand

public String expand(String prefix,
                     String localName)
Description copied from interface: PrefixMap
Expand a prefix, return null if it can't be expanded

Parameters:
prefix - Prefix
localName - Local name
Returns:
Expanded URI if possible, null otherwise

getMapping

public Map<String,org.apache.jena.iri.IRI> getMapping()
Description copied from interface: PrefixMap
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

Returns:
Underlying mapping

contains

public boolean contains(String prefix)
Description copied from interface: PrefixMap
Gets whether the map contains a given prefix

Parameters:
prefix - Prefix
Returns:
True if the prefix is contained in the map, false otherwise

abbreviate

public String abbreviate(String uriStr)
Description copied from interface: PrefixMap
Abbreviate an IRI or return null

Parameters:
uriStr - URI to abbreviate
Returns:
URI in prefixed name form if possible, null otherwise

abbrev

public Pair<String,String> abbrev(String uriStr)
Description copied from interface: PrefixMap
Abbreviate an IRI and return a pair of prefix and local parts, or null.

Parameters:
uriStr - URI string to abbreviate
Returns:
Pair of prefix and local name
See Also:
PrefixMap.abbreviate(java.lang.String)

isEmpty

public boolean isEmpty()
Description copied from interface: PrefixMap
return whether the

Returns:
boolean

size

public int size()
Description copied from interface: PrefixMap
Return the number of entries in the prefix map.

Returns:
Size of the prefix mapping


Licenced under the Apache License, Version 2.0