Class AsSynchronizedGraph.CacheAccess

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private CacheAccess()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      E addEdge​(V sourceVertex, V targetVertex)
      Add an edge into AsSynchronizedGraph's backing graph.
      boolean addEdge​(V sourceVertex, V targetVertex, E e)
      Add an edge into AsSynchronizedGraph's backing graph.
      private void edgeModified​(V sourceVertex, V targetVertex)
      Clear the copies which the edge to be added or removed can affect.
      java.util.Set<E> edgesOf​(V vertex)
      Get all edges touching the specified vertex in AsSynchronizedGraph's backing graph.
      java.util.Set<E> incomingEdgesOf​(V vertex)
      Get a set of all edges in AsSynchronizedGraph's backing graph incoming into the specified vertex.
      boolean isCacheEnabled()
      Return whether the graph uses cache for edgesOf, incomingEdgesOf and outgoingEdgesOf methods.
      java.util.Set<E> outgoingEdgesOf​(V vertex)
      Get a set of all edges in AsSynchronizedGraph's backing graph outgoing from the specified vertex.
      boolean removeEdge​(E e)
      Remove the specified edge from AsSynchronizedGraph's backing graph.
      E removeEdge​(V sourceVertex, V targetVertex)
      Remove an edge from AsSynchronizedGraph's backing graph.
      boolean removeVertex​(V v)
      Remove the specified vertex from AsSynchronizedGraph's backing graph.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • incomingEdgesMap

        private final transient java.util.Map<V,​java.util.Set<E>> incomingEdgesMap
      • outgoingEdgesMap

        private final transient java.util.Map<V,​java.util.Set<E>> outgoingEdgesMap
      • edgesOfMap

        private final transient java.util.Map<V,​java.util.Set<E>> edgesOfMap
    • Constructor Detail

      • CacheAccess

        private CacheAccess()
    • Method Detail

      • edgesOf

        public java.util.Set<E> edgesOf​(V vertex)
        Get all edges touching the specified vertex in AsSynchronizedGraph's backing graph.
        Specified by:
        edgesOf in interface AsSynchronizedGraph.CacheStrategy<V,​E>
      • edgeModified

        private void edgeModified​(V sourceVertex,
                                  V targetVertex)
        Clear the copies which the edge to be added or removed can affect.
        Parameters:
        sourceVertex - source vertex of the modified edge.
        targetVertex - target vertex of the modified edge.
      • isCacheEnabled

        public boolean isCacheEnabled()
        Return whether the graph uses cache for edgesOf, incomingEdgesOf and outgoingEdgesOf methods.
        Specified by:
        isCacheEnabled in interface AsSynchronizedGraph.CacheStrategy<V,​E>
        Returns:
        true if cache is in use, false if cache is not in use.