Interface ILabeledPath<N,A>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default voidextend(N newHead)Modifies the path by adding a new node at the end.voidextend(N newHead, A arcToNewHead)Like inIPath, but the new arc is labeled as well.java.util.List<A>getArcs()AgetInArc(N node)AgetOutArc(N node)ILabeledPath<N,A>getPathFromChildOfRoot()Creates a new path object that is identical to the current path except that the root is removed.ILabeledPath<N,A>getPathToParentOfHead()Creates a new path object that is identical to the current path except that the head is removed.ILabeledPath<N,A>getUnmodifiableAccessor()Creates an accessor to the path that cannot be changed.-
Methods inherited from interface org.api4.java.datastructure.graph.IPath
containsNode, cutHead, getHead, getNodes, getNumberOfNodes, getParentOfHead, getRoot, isPoint
-
-
-
-
Method Detail
-
getUnmodifiableAccessor
ILabeledPath<N,A> getUnmodifiableAccessor()
Description copied from interface:IPathCreates an accessor to the path that cannot be changed. This can be useful for getters that want to return an immutable path.- Specified by:
getUnmodifiableAccessorin interfaceIPath<N>- Returns:
- The unmodifiable accessor of the path.
-
extend
void extend(N newHead, A arcToNewHead)
Like inIPath, but the new arc is labeled as well.- Parameters:
newHead-arcToNewHead-
-
getPathToParentOfHead
ILabeledPath<N,A> getPathToParentOfHead()
Description copied from interface:IPathCreates a new path object that is identical to the current path except that the head is removed. This is equivalent to creating a copy of the current path and invoke cutHead() on it.- Specified by:
getPathToParentOfHeadin interfaceIPath<N>- Returns:
- The copy of the current path with the head being the parent of the head of the current path.
-
getPathFromChildOfRoot
ILabeledPath<N,A> getPathFromChildOfRoot()
Description copied from interface:IPathCreates a new path object that is identical to the current path except that the root is removed.- Specified by:
getPathFromChildOfRootin interfaceIPath<N>- Returns:
- The copy of the current path with the root being the second node of the current path.
-
getArcs
java.util.List<A> getArcs()
- Returns:
- The list of labels of the arcs in the order of the path.
-
getInArc
A getInArc(N node)
- Parameters:
node-- Returns:
- The label of the arc leading to the given node
-
getOutArc
A getOutArc(N node)
- Parameters:
node-- Returns:
- The label of the arc going away from the given node
-
-