Class UntypedGraphImpl<V extends Vertex,​E extends Edge>

    • Field Detail

      • edges

        protected final GraphEntities<E extends Edge> edges
        class instance containing all edges
      • vertices

        protected final GraphEntities<V extends Vertex> vertices
        class instance containing all vertices
    • Constructor Detail

      • UntypedGraphImpl

        public UntypedGraphImpl​(IdGroupingToken groupId,
                                GraphEntities<V> vertices,
                                GraphEntities<E> edges)
        Graph Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        vertices - to use
        edges - to use
      • UntypedGraphImpl

        public UntypedGraphImpl​(UntypedGraphImpl<V,​E> other,
                                boolean deepCopy)
        Copy constructor for shallow copy
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
      • UntypedGraphImpl

        public UntypedGraphImpl​(UntypedGraphImpl<V,​E> other,
                                boolean deepCopy,
                                GraphEntityDeepCopyMapper<V> vertexMapper,
                                GraphEntityDeepCopyMapper<E> edgesMapper)
        Copy constructor for shallow copy
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
        vertexMapper - to use for tracking mapping between original and copied vertices
        edgesMapper - to use for tracking mapping between original and copied edges
    • Method Detail

      • generatedGraphId

        protected static long generatedGraphId​(IdGroupingToken groupId)
        Generate a graph id
        Parameters:
        groupId - to use
        Returns:
        the generated id
      • getGraphIdGroupingToken

        public IdGroupingToken getGraphIdGroupingToken()
        Collect the id grouping token used for all entities registered on the graph, i.e., this graph specific identifier for generating ids unique and contiguous within this network and this network only
        Returns:
        the graph id grouping token
      • recreateManagedIds

        public long recreateManagedIds​(IdGroupingToken tokenId)
        recreate the internal id(s) and set them including the Idable id
        Specified by:
        recreateManagedIds in interface ManagedId
        Parameters:
        tokenId - to use (may be null in case managed id entity does not rely on token to recreate its managed id(s))
        Returns:
        the updated internal id
      • getIdClass

        public Class<UntypedGraph> getIdClass()
        Each managed id class is expected to generate its ids based on its class signature. To be able to generate the correct id the class used for id generation is to be provided via this method call.
        Specified by:
        getIdClass in interface ManagedId
        Returns:
        idClass to use for generating ids for instances of this idable derived class
      • deepClone

        public UntypedGraph<V,​E> deepClone()
        An id entity should always support a deep copy, i.e., all "owned" members will be deep copied when a clone of this instance is created via this call. To be used with caution if not called by managed id container related code
        Specified by:
        deepClone in interface IdAble
        Specified by:
        deepClone in interface UntypedGraph<V extends Vertex,​E extends Edge>
        Specified by:
        deepClone in class IdAbleImpl
        Returns:
        deep copy of entity
      • smartDeepClone

        public UntypedGraphImpl<V,​E> smartDeepClone​(GraphEntityDeepCopyMapper<V> vertexMapper,
                                                          GraphEntityDeepCopyMapper<E> edgeMapper)
        A smart deep clone updates known interdependencies between vertices, edges, and edge segments utilising the graph entity deep copy mappers
        Parameters:
        vertexMapper - tracking original to copy mappings
        edgeMapper - tracking original to copy mappings
        Returns:
        created copy