Class ManagedDirectedPathImpl

    • Constructor Detail

      • ManagedDirectedPathImpl

        protected ManagedDirectedPathImpl​(IdGroupingToken groupId)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
      • ManagedDirectedPathImpl

        protected ManagedDirectedPathImpl​(IdGroupingToken groupId,
                                          Deque<? extends EdgeSegment> pathEdgeSegments)
        Constructor
        Parameters:
        groupId - contiguous id generation within this group for instances of this class
        pathEdgeSegments - the path to set (not copied)
      • ManagedDirectedPathImpl

        protected ManagedDirectedPathImpl​(ManagedDirectedPathImpl other,
                                          boolean deepCopy)
        Copy constructor
        Parameters:
        other - to copy
        deepCopy - when true, create a deep copy, shallow copy otherwise
    • Method Detail

      • generateId

        protected static long generateId​(IdGroupingToken groupId)
        Generate an id for this instance
        Parameters:
        groupId - to use
        Returns:
        created id
      • 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
      • size

        public long size()
        The size of the path is given by the number of edge segments it holds
        Specified by:
        size in interface SimpleDirectedPath
        Returns:
        size
      • containsSubPath

        public boolean containsSubPath​(Collection<? extends EdgeSegment> subPath)
        Verify if the path contains the provided subpath. It is only a subpath of the subpath is present continguously
        Specified by:
        containsSubPath in interface SimpleDirectedPath
        Parameters:
        subPath - to verify
        Returns:
        true when it contains the subpath, false otherwise.
      • containsSubPath

        public boolean containsSubPath​(Iterator<? extends EdgeSegment> subPath)
        Verify if the path contains the provided subpath. It is only a subpath of the subpath is present contiguously
        Specified by:
        containsSubPath in interface SimpleDirectedPath
        Parameters:
        subPath - to verify
        Returns:
        true when it contains the subpath, false otherwise.
      • deepClone

        public ManagedDirectedPathImpl 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 ManagedDirectedPath
        Overrides:
        deepClone in class ExternalIdAbleImpl
        Returns:
        deep copy of entity