abstract class TraverserMethods[A, +CC <: TraverserMethods[A, CC]] extends FluentProperties[CC]
The root-related methods Traverser will inherit.
- Attributes
- protected
- Self Type
- CC with Properties
- Alphabetic
- By Inheritance
- TraverserMethods
- FluentProperties
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TraverserMethods()
Abstract Value Members
- abstract def apply[U](pred: GraphTraversal.NodePredicate = noNode, visitor: (A) => U = empty): Option[NodeT]
- Attributes
- protected
- abstract def edgeVisitor[U](f: (A) => U): (GraphTraversal.EdgeT) => U
- Attributes
- protected
- abstract def findCycle[U](implicit visitor: (A) => U = empty): Option[Cycle]
Finds a cycle starting the search at
roottaking optional properties like subgraph restriction, ordering or maximum depth into account., if any.Finds a cycle starting the search at
roottaking optional properties like subgraph restriction, ordering or maximum depth into account., if any. The resulting cycle may start at any node connected withthisnode.- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
A cycle or
Noneif either- there exists no cycle in the component depicting by
rootor - there exists a cycle in the component but due to withSubgraph settings this path was out of scope.
- there exists no cycle in the component depicting by
- abstract def newTraverser: (NodeT, Parameters, GraphTraversal.NodePredicate, GraphTraversal.EdgePredicate, GraphTraversal.ElemOrdering, Option[Weight]) => CC
- Attributes
- protected
- Definition Classes
- FluentProperties
- abstract def nodeVisitor[U](f: (A) => U): (NodeT) => U
- Attributes
- protected
- abstract def partOfCycle[U](implicit visitor: (A) => U = empty): Option[Cycle]
Finds a cycle that contains
roottaking optional properties like subgraph restriction, ordering or maximum depth into account..Finds a cycle that contains
roottaking optional properties like subgraph restriction, ordering or maximum depth into account.. Irrespective of the current setting forkind,DepthFirstis used internally.- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
A cycle containing
rootorNoneif either- there exists no cycle containing
rootor - there exists such a cycle but due to withSubgraph settings this path was out of scope.
- there exists no cycle containing
- abstract def pathUntil[U](pred: GraphTraversal.NodePredicate)(implicit visitor: (A) => U = empty): Option[Path]
Finds a path from
rootto a successor ofrootfor whichpredholds considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Finds a path from
rootto a successor ofrootfor whichpredholds considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.rootitself does not count as a match. This is also true if it has a hook. If several successors exist the algorithm selects any one of these.- pred
The predicate which must hold true for the successor.
- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
A path to a node with the predicate
predorNoneif either- there is no node with
predor - there exists no path to such a node or
- there exists a path to such a node but due to withSubgraph settings this path was out of scope.
- there is no node with
- abstract def root: NodeT
- abstract def shortestPathTo[T, U](potentialSuccessor: NodeT, weight: (GraphTraversal.EdgeT) => T, visitor: (A) => U)(implicit arg0: Numeric[T]): Option[Path]
Finds the shortest path from
roottopotentialSuccessorconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Finds the shortest path from
roottopotentialSuccessorconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method. The calculation is based on the weight of the edges on the path. Edges have a default weight of1Lthat can be overridden by custom edges. A weight function yielding any numeric type may also be passed toshortestPathTo.- potentialSuccessor
The node the shortest path is to be found to.
- weight
Function to determine the weight of edges. If supplied, this function takes precedence over edge weights.
- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
The shortest path to
potentialSuccessororNoneif either- there exists no path to
potentialSuccessoror - there exists a path to
potentialSuccessorbut due to withSubgraph settings this path was out of scope.
- there exists no path to
- abstract def strongComponents[U](implicit visitor: (A) => U = empty): Iterable[Component]
Finds all strongly connected components reachable from this node.
Finds all strongly connected components reachable from this node. See
componentTraverserfor more control by means ofFluentProperties.- visitor
Function to be called for each inner node or inner edge visited during the search.
- abstract def topologicalSort[U](ignorePredecessors: Boolean = false)(implicit visitor: (GraphTraversal.InnerElem) => U = empty): TopologicalSort
Sorts the component designated by this node topologically.
Sorts the component designated by this node topologically. Only nodes connected with this node will be included in the resulting topological order. If the graph is known to be connected choose GraphTraversal#topologicalSort instead. See
componentTraverserfor more control by means ofFluentProperties.- ignorePredecessors
If
true, the topological sort will be partial in that it will only include successors ofroot.withSubgraphrestricts the successor nodes to be included but not predecessors that will be excluded in total.- visitor
Function to be called for each inner node or inner edge visited during the sort.
- abstract def weakComponent[U](implicit visitor: (A) => U = empty): Component
Determines the weak component that contains this node.
Determines the weak component that contains this node. See
componentTraverserfor more control by means ofFluentProperties.- visitor
Function to be called for each inner node or inner edge visited during the search.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- def +(other: String): String
- Implicit
- This member is added by an implicit conversion from TraverserMethods[A, CC] toany2stringadd[TraverserMethods[A, CC]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (TraverserMethods[A, CC], B)
- Implicit
- This member is added by an implicit conversion from TraverserMethods[A, CC] toArrowAssoc[TraverserMethods[A, CC]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def ensuring(cond: (TraverserMethods[A, CC]) => Boolean, msg: => Any): TraverserMethods[A, CC]
- Implicit
- This member is added by an implicit conversion from TraverserMethods[A, CC] toEnsuring[TraverserMethods[A, CC]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (TraverserMethods[A, CC]) => Boolean): TraverserMethods[A, CC]
- Implicit
- This member is added by an implicit conversion from TraverserMethods[A, CC] toEnsuring[TraverserMethods[A, CC]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): TraverserMethods[A, CC]
- Implicit
- This member is added by an implicit conversion from TraverserMethods[A, CC] toEnsuring[TraverserMethods[A, CC]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): TraverserMethods[A, CC]
- Implicit
- This member is added by an implicit conversion from TraverserMethods[A, CC] toEnsuring[TraverserMethods[A, CC]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def findConnected[U](pred: GraphTraversal.NodePredicate)(implicit visitor: (A) => U = empty): Option[NodeT]
Finds a node connected with
rootby any number of edges with any direction for which the predicatepredholds considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Finds a node connected with
rootby any number of edges with any direction for which the predicatepredholds considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method. For directed or mixed graphs the node to be found is weakly connected with this node.rootitself does not count as a match. This is also true if it has a hook. If several connected nodes exist withpredthe algorithm selects any one of these.- pred
The predicate which must hold true for the resulting node.
- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
A node with the predicate
predorNoneif either- there is no node with
predor - there exists no connection to such a node or
- there exists a connection to such a node but due to withSubgraph settings this path was out of scope.
- there is no node with
- final def findPredecessor[U](pred: GraphTraversal.NodePredicate)(implicit visitor: (A) => U = empty): Option[NodeT]
Finds a predecessor of
rootfor which the predicatepredholds considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Finds a predecessor of
rootfor which the predicatepredholds considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.rootitself does not count as a match. This is also true if it has a hook. If several predecessors exist the algorithm selects the first of them found.- pred
The predicate which must hold true for the resulting node.
- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
A node with the predicate
predorNoneif either- there is no node with
predor - there exists no path from such a node to this node or
- there exists a path from such a node to
rootbut due to withSubgraph settings this path was out of scope.
- there is no node with
- final def findSuccessor[U](pred: GraphTraversal.NodePredicate)(implicit visitor: (A) => U = empty): Option[NodeT]
Finds a successor of
rootfor which the predicatepredholds considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Finds a successor of
rootfor which the predicatepredholds considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.rootitself does not count as a match. This is also true if it has a hook. If several successors holdingpredexist any one of them may be returned.- pred
The predicate which must hold for the resulting node.
- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
A node with the predicate
predorNoneif either- there is no node with
predor - there exists no path to such a node or
- there exists a path to such a node but due to withSubgraph settings this path was out of scope.
- there is no node with
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def hasPredecessor[U](potentialPredecessor: NodeT)(implicit visitor: (A) => U = empty): Boolean
Checks whether
potentialPredecessoris a predecessor ofrootconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Checks whether
potentialPredecessoris a predecessor ofrootconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method. Same asisSuccessorOf.- potentialPredecessor
The node which is potentially a predecessor of
root.- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
trueif a path exists frompotentialPredecessortorootand it had not to be excluded due tosubgraphproperties.
- Annotations
- @inline()
- final def hasSuccessor[U](potentialSuccessor: NodeT)(implicit visitor: (A) => U = empty): Boolean
Checks whether
potentialSuccessoris a successor of this node considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Checks whether
potentialSuccessoris a successor of this node considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method. Same asisPredecessorOf.- potentialSuccessor
The node which is potentially a successor of this node.
- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
trueif a path exists from this node topotentialSuccessorand it had not to be excluded due to asubgraph*restriction.
- Annotations
- @inline()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isConnectedWith[U](potentialConnected: NodeT)(implicit visitor: (A) => U = empty): Boolean
Checks whether
potentialConnectedis a node (not necessarily directly) connected withrootby any number of edges with any direction considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Checks whether
potentialConnectedis a node (not necessarily directly) connected withrootby any number of edges with any direction considering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method. For directed or mixed graphs it is satisfactory thatpotentialConnectedis weakly connected withroot.- potentialConnected
The node which is potentially connected with
root.- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
trueif a path exists from this node topotentialConnectedand it had not to be excluded due tosubgraphproperties.
- Annotations
- @inline()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def isPredecessorOf[U](potentialSuccessor: NodeT)(implicit visitor: (A) => U = empty): Boolean
Same as
hasSuccessor.Same as
hasSuccessor.- Annotations
- @inline()
- final def isSuccessorOf[U](potentialPredecessor: NodeT)(implicit visitor: (A) => U = empty): Boolean
Same as
hasPredecessor.Same as
hasPredecessor.- Annotations
- @inline()
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def pathTo[U](potentialSuccessor: NodeT)(implicit visitor: (A) => U = empty): Option[Path]
Finds a path from
roottopotentialSuccessorconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Finds a path from
roottopotentialSuccessorconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.- potentialSuccessor
The node a path is to be found to.
- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
A path to
potentialSuccessororNoneif either- there is no node with
predor - there exists no path to such a node
- there is no node with
- final def requireSuccessors[A](block: => A): A
- Attributes
- protected
- final def shortestPathTo[T](potentialSuccessor: NodeT, weight: (GraphTraversal.EdgeT) => T)(implicit arg0: Numeric[T]): Option[Path]
Finds the shortest path from
roottopotentialSuccessorconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Finds the shortest path from
roottopotentialSuccessorconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method. The calculation is based on the weight of the edges on the path. Edges have a default weight of1Lthat can be overridden by custom edges. A weight function yielding any numeric type may also be passed toshortestPathTo.- potentialSuccessor
The node the shortest path is to be found to.
- weight
Function to determine the weight of edges. If supplied, this function takes precedence over edge weights.
- returns
The shortest path to
potentialSuccessororNoneif either- there exists no path to
potentialSuccessoror - there exists a path to
potentialSuccessorbut due to withSubgraph settings this path was out of scope.
- there exists no path to
- Annotations
- @inline()
- final def shortestPathTo[U](potentialSuccessor: NodeT)(implicit visitor: (A) => U = empty): Option[Path]
Finds the shortest path from
roottopotentialSuccessorconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method.Finds the shortest path from
roottopotentialSuccessorconsidering all traversal properties passed to the traverser factory method like scalax.collection.GraphTraversal#innerNodeTraverser or altered by anywith*method. The calculation is based on the weight of the edges on the path. Edges have a default weight of1Lthat can be overridden by custom edges. A weight function yielding any numeric type may also be passed toshortestPathTo.- potentialSuccessor
The node the shortest path is to be found to.
- visitor
An optional function that is applied for its side-effect to every element visited during graph traversal.
- returns
The shortest path to
potentialSuccessororNoneif either- there exists no path to
potentialSuccessoror - there exists a path to
potentialSuccessorbut due to withSubgraph settings this path was out of scope.
- there exists no path to
- Annotations
- @inline()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- final def toInnerElemTraverser(root: NodeT): InnerElemTraverser
- Definition Classes
- FluentProperties
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def withDirection(direction: Direction): CC
Creates a new FluentProperties based on
thisexcept for an updateddirection.Creates a new FluentProperties based on
thisexcept for an updateddirection. Note that methods returning a Cycle or Path accept onlySuccessors.- Definition Classes
- FluentProperties
- final def withKind(kind: Kind): CC
Creates a new FluentProperties based on
thisexcept for an updatedkind.Creates a new FluentProperties based on
thisexcept for an updatedkind.- Definition Classes
- FluentProperties
- final def withMaxDepth(maxDepth: Int): CC
Creates a new FluentProperties based on
thisexcept for an updatedmaxDepth.Creates a new FluentProperties based on
thisexcept for an updatedmaxDepth.- Definition Classes
- FluentProperties
- final def withMaxWeight(max: Long): CC
Creates a new FluentProperties based on
thisexcept for an updatedmaxWeighthaving the givenmaxand the default weight function returningedge.weight.Creates a new FluentProperties based on
thisexcept for an updatedmaxWeighthaving the givenmaxand the default weight function returningedge.weight.- Definition Classes
- FluentProperties
- final def withMaxWeight[W](max: W, edgeWeight: (GraphTraversal.EdgeT) => W)(implicit arg0: Numeric[W]): CC
Creates a new FluentProperties based on
thisexcept for an updatedmaxWeighthaving the givenmaxvalue and the given weight function.Creates a new FluentProperties based on
thisexcept for an updatedmaxWeighthaving the givenmaxvalue and the given weight function.- Definition Classes
- FluentProperties
- def withMaxWeight(maxWeight: Option[Weight]): CC
Creates a new FluentProperties based on
thisexcept for an updatedmaxWeight.Creates a new FluentProperties based on
thisexcept for an updatedmaxWeight.- Definition Classes
- FluentProperties
- final def withOrdering(ordering: GraphTraversal.ElemOrdering): CC
Creates a new FluentProperties based on
thisexcept for an updatedordering.Creates a new FluentProperties based on
thisexcept for an updatedordering.- Definition Classes
- FluentProperties
- final def withParameters(parameters: Parameters): CC
Creates a new FluentProperties based on
thisexcept for an updatedparameters.Creates a new FluentProperties based on
thisexcept for an updatedparameters.- Definition Classes
- FluentProperties
- final def withRoot(root: NodeT): CC
Creates a new FluentProperties based on
thisexcept for an updatedroot. - final def withSubgraph(nodes: GraphTraversal.NodePredicate = anyNode, edges: GraphTraversal.EdgePredicate = anyEdge): CC
Creates a new FluentProperties based on
thisexcept for an updatedsubgraphNodesand/orsubgraphEdges.Creates a new FluentProperties based on
thisexcept for an updatedsubgraphNodesand/orsubgraphEdges.- Definition Classes
- FluentProperties
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from TraverserMethods[A, CC] toStringFormat[TraverserMethods[A, CC]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @deprecated @inline()
- Deprecated
(Since version 2.12.16) Use
formatString.format(value)instead ofvalue.formatted(formatString), or use thef""string interpolator. In Java 15 and later,formattedresolves to the new method in String which has reversed parameters.
- def →[B](y: B): (TraverserMethods[A, CC], B)
- Implicit
- This member is added by an implicit conversion from TraverserMethods[A, CC] toArrowAssoc[TraverserMethods[A, CC]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
Welcome to the Graph for Scala API reference. Some suggested entry points:
AnyGraphimmutable.Graphand its inner nodesmutable.Graphand its inner nodes.edgespackage and its subpackageshyperedgespackage and its subpackages.labeled edgespackagemultilabeled edgespackagelabeled hyperedgespackagemultilabeled hyperedgespackageordered labeled hyperedgespackageordered multilabeled hyperedgesobjectgenericpackage.GraphTraversalandTraverserInnerNode.RandomGraph.GraphGen.