Class BufferingPrefixMap

java.lang.Object
org.apache.jena.riot.system.PrefixMapBase
org.apache.jena.system.buffering.BufferingPrefixMap
All Implemented Interfaces:
PrefixMap

public class BufferingPrefixMap extends PrefixMapBase
A PrefixMap that buffers changes until flush() is called.
  • Constructor Details

    • BufferingPrefixMap

      public BufferingPrefixMap(PrefixMap prefixes)
  • Method Details

    • getMapping

      public Map<String,String> 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
      See Also:
    • getMappingCopy

      public Map<String,String> getMappingCopy()
      Description copied from interface: PrefixMap
      Return a fresh copy of the underlying mapping, should be safe to modify unlike the mapping returned from PrefixMap.getMapping()
      Specified by:
      getMappingCopy in interface PrefixMap
      Overrides:
      getMappingCopy in class PrefixMapBase
      Returns:
      Copy of the mapping
    • forEach

      public void forEach(BiConsumer<String,String> action)
      Description copied from interface: PrefixMap
      Apply a BiConsumer<String, String> to each entry in the PrefixMap.
      Specified by:
      forEach in interface PrefixMap
      Overrides:
      forEach in class PrefixMapBase
    • stream

      public Stream<PrefixEntry> stream()
      Description copied from interface: PrefixMap
      Return a stream of PrefixEntry, pairs of prefix and URI.
      Specified by:
      stream in interface PrefixMap
      Overrides:
      stream in class PrefixMapBase
    • get

      public String get(String prefix)
      Description copied from interface: PrefixMap
      Return the URI for the prefix, or null if there is no entry for this prefix.
    • add

      public void add(String prefix, String iriString)
      Description copied from interface: PrefixMap
      Add a prefix, overwrites any existing association
      Parameters:
      prefix - Prefix
      iriString - Namespace IRI
    • delete

      public void delete(String prefix)
      Description copied from interface: PrefixMap
      Delete a prefix
      Parameters:
      prefix - Prefix to delete
    • clear

      public void clear()
      Description copied from interface: PrefixMap
      Clear all prefixes.
    • containsPrefix

      public boolean containsPrefix(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
    • isEmpty

      public boolean isEmpty()
      Description copied from interface: PrefixMap
      Return whether the prefix map is empty or not.
    • size

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

      public PrefixMap base()
    • flush

      public void flush()
    • state

      public String state()