Class SimpleGraphMaker

  • All Implemented Interfaces:
    GraphMaker

    public class SimpleGraphMaker
    extends BaseGraphMaker
    A SimpleGraphFactory produces memory-based graphs and records them in a local map.
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleGraphMaker()
      Initialise a SimpleGraphMaker with reification style Minimal
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()
      Close this factory - we choose to do nothing.
      Graph create()  
      Graph createGraph​(java.lang.String name, boolean strict)
      Create a graph and record it with the given name in the local map.
      boolean hasGraph​(java.lang.String name)
      Return true iff we have a graph with the given name
      ExtendedIterator<java.lang.String> listGraphs()
      Answer an [extended] iterator where each element is the name of a graph in the maker, and the complete sequence exhausts the set of names.
      Graph openGraph()
      Answer the default graph of this GraphMaker, if it has one.
      Graph openGraph​(java.lang.String name, boolean strict)
      Open (aka find) a graph with the given name in the local map.
      void removeGraph​(java.lang.String name)
      Remove the mapping from name to any graph from the local map.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SimpleGraphMaker

        public SimpleGraphMaker()
        Initialise a SimpleGraphMaker with reification style Minimal
    • Method Detail

      • create

        public Graph create()
      • createGraph

        public Graph createGraph​(java.lang.String name,
                                 boolean strict)
        Create a graph and record it with the given name in the local map.
        Parameters:
        name - the name to give to the new graph
        strict - true to cause existing bindings to throw an exception
      • openGraph

        public Graph openGraph​(java.lang.String name,
                               boolean strict)
        Open (aka find) a graph with the given name in the local map.
        Parameters:
        name - the name of the graph to find and return
        strict - false to create a new one if one doesn't already exist
      • removeGraph

        public void removeGraph​(java.lang.String name)
        Remove the mapping from name to any graph from the local map.
        Parameters:
        name - the name to disassociate
      • hasGraph

        public boolean hasGraph​(java.lang.String name)
        Return true iff we have a graph with the given name
        Parameters:
        name - the name of the graph to look for
        Returns:
        true iff there's a graph with that name
      • close

        public void close()
        Close this factory - we choose to do nothing.
      • listGraphs

        public ExtendedIterator<java.lang.String> listGraphs()
        Description copied from interface: GraphMaker
        Answer an [extended] iterator where each element is the name of a graph in the maker, and the complete sequence exhausts the set of names. No particular order is expected from the list.
        Returns:
        an extended iterator over the names of graphs known to this Maker.