class Connected[N, E[+X] <: EdgeLikeIn[X], G <: Graph[N, E]] extends Constraint[N, E, G]
Ensures that the underlying Graph
is connected if it is undirected
or weakly connected if it is directed.
- Alphabetic
- By Inheritance
- Connected
- Constraint
- ConstraintMethods
- AnyRef
- Any
- by ChainingOps
- by EdgeAssoc
- by anyToNode
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Connected(self: G)
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- def &&(that: Constraint[N, E, G]): ConstraintBinaryOp[N, E, G]
Creates a new constraint of the type
ConstraintBinaryOp
with pre- and post-check methods each of which returningtrue
if boththis
' andthat
's corresponding pre- and post-checks returntrue
.Creates a new constraint of the type
ConstraintBinaryOp
with pre- and post-check methods each of which returningtrue
if boththis
' andthat
's corresponding pre- and post-checks returntrue
.- Definition Classes
- Constraint
- def +(other: String): String
- def ->[B](y: B): (Connected[N, E, G], B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def allNodes(passedNodes: Iterable[N], passedEdges: Iterable[E[N]]): Set[N]
Consolidates all outer nodes of the arguments by adding the edge ends of
passedEdges
topassedNodes
.Consolidates all outer nodes of the arguments by adding the edge ends of
passedEdges
topassedNodes
.- Attributes
- protected
- Definition Classes
- ConstraintMethods
- 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: (Connected[N, E, G]) => Boolean, msg: => Any): Connected[N, E, G]
- def ensuring(cond: (Connected[N, E, G]) => Boolean): Connected[N, E, G]
- def ensuring(cond: Boolean, msg: => Any): Connected[N, E, G]
- def ensuring(cond: Boolean): Connected[N, E, G]
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def formatted(fmtstr: String): String
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def isConnected(include: Set[G.NodeT], excludeNodes: Set[G.NodeT], excludeEdges: Set[G.EdgeT]): Boolean
Checks within any
preSubtract
whether the neighborhood of the elements to be subtracted remains connected after the subtraction thus preventing a full traversal of the graph.Checks within any
preSubtract
whether the neighborhood of the elements to be subtracted remains connected after the subtraction thus preventing a full traversal of the graph.- include
nodes in the neighborhood of the nodes/edges to be subtracted.
- excludeNodes
nodes to be subtracted.
- excludeEdges
edges to be subtracted.
- returns
true
if all nodes ininclude
are connected.
- Attributes
- protected
- def isDefined: Boolean
- final def isEdge: Boolean
- def isIn: Boolean
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNode: Boolean
- final def isOut: Boolean
- val n1: Connected[N, E, G]
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nodesToAdd(passedNodes: Iterable[N], passedEdges: Iterable[E[N]]): Set[N]
- Attributes
- protected
- Definition Classes
- ConstraintMethods
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def pipe[B](f: (Connected[N, E, G]) => B): B
- Implicit
- This member is added by an implicit conversion from Connected[N, E, G] toChainingOps[Connected[N, E, G]] performed by method ChainingOps in scalax.collection.
- Definition Classes
- ChainingOps
- def postAdd(newGraph: G, passedNodes: Iterable[N], passedEdges: Iterable[E[N]], preCheck: PreCheckResult): Either[PostCheckFailure, G]
Check the whole
newGraph
.Check the whole
newGraph
.- newGraph
the after-addition would-be graph waiting for commit.
- passedNodes
the normalized nodes passed to the add operation.
- passedEdges
the normalized edges passed to the add operation.
- preCheck
the result of
preAdd
.- returns
None
to acceptnewGraph
orSome
reason for constraint violation resp. rejection
- Definition Classes
- Connected → ConstraintMethods
- def postSubtract(newGraph: G, passedNodes: Iterable[N], passedEdges: Iterable[E[N]], preCheck: PreCheckResult): Either[PostCheckFailure, G]
This post-check must return whether
newGraph
should be committed or the subtraction is to be rolled back.This post-check must return whether
newGraph
should be committed or the subtraction is to be rolled back. Useself
to access the associated graph. For immutable graphs,self
maintains the state before the addition but for mutable graphs, it is already mutated to the required state.- newGraph
the after-subtraction would-be graph waiting for commit.
- passedNodes
the normalized nodes passed to the subtraction operation.
- passedEdges
the normalized edges passed to the subtraction operation.
- preCheck
the result of
preSubtract
.- returns
None
to acceptnewGraph
orSome
reason for constraint violation resp. rejection
- Definition Classes
- ConstraintMethods
- def preAdd(elems: InParam[N, E]*): PreCheckResult
Complete
ifelems
build a connected graph and at least one node ofelems
is already contained; otherwiseAbort
.Complete
ifelems
build a connected graph and at least one node ofelems
is already contained; otherwiseAbort
.- elems
nodes and/or edges to be added possibly containing duplicates.
- returns
The results of the pre-check containing the follow-up activity and possibly any intermediate computation result to be used during the post-check. To add computation results
PreCheckResult
must be extended.
- Definition Classes
- Connected → ConstraintMethods
- def preAdd(edge: E[N]): PreCheckResult
Complete
ifedge
itself or at least one end ofedge
is already contained; otherwiseAbort
.Complete
ifedge
itself or at least one end ofedge
is already contained; otherwiseAbort
.- edge
to be added.
- returns
The results of the pre-check containing the follow-up activity and possibly any intermediate computation result to be used during the post-check. To add computation results
PreCheckResult
must be extended.
- Definition Classes
- Connected → ConstraintMethods
- def preAdd(node: N): PreCheckResult
Complete
ifnode
is contained even though no addition will be performed; otherwiseAbort
becausenode
would become isolated.Complete
ifnode
is contained even though no addition will be performed; otherwiseAbort
becausenode
would become isolated.- node
to be added
- returns
The results of the pre-check containing the follow-up activity and possibly any intermediate computation result to be used during the post-check. To add computation results
PreCheckResult
must be extended.
- Definition Classes
- Connected → ConstraintMethods
- def preCreate(nodes: Iterable[N], edges: Iterable[E[N]]): PreCheckResult
Skips this pre-check to rely on the post-check
postAdd
except for trivial cases.Skips this pre-check to rely on the post-check
postAdd
except for trivial cases.- nodes
the outer nodes the graph is to be populated with; nodes being edge ends may but need not be contained in
nodes
.- edges
the outer edges the graph is to be populated with.
- returns
The results of the pre-check containing the follow-up activity and possibly any intermediate computation result to be used during the post-check. To add computation results
PreCheckResult
must be extended.
- Definition Classes
- Connected → ConstraintMethods
- def preSubtract(nodes: => Set[G.NodeT], edges: => Set[G.EdgeT], simple: Boolean): PreCheckResult
This pre-check must return
Abort
if the subtraction ofnodes
and/oredges
is to be canceled,PostCheck
ifpostSubtract
is to be called to decide orComplete
ifnodes
and/oredges
are allowed to be subtracted.This pre-check must return
Abort
if the subtraction ofnodes
and/oredges
is to be canceled,PostCheck
ifpostSubtract
is to be called to decide orComplete
ifnodes
and/oredges
are allowed to be subtracted. It is typically triggered by the--
operation. The default implementation element-wise callspreSubtract(node, simple)
orpreSubtract(edge, simple)
, respectively. As for most cases this won't be satisfactory a domain-specific implementation should be provided. Useself
to access the associated graph.- nodes
the inner nodes to be subtracted not necessarily including the ends of edges to be subtracted. Call allNodes to get the complete set of nodes to be subtracted.
- edges
the inner edges to be subtracted.
- simple
true
for standard (edge-only by-
),false
for ripple (by-!
) removal.- returns
The results of the pre-check containing the follow-up activity and possibly any intermediate computation result to be used during the post-check. To add computation results
PreCheckResult
must be extended.
- Definition Classes
- Connected → ConstraintMethods
- def preSubtract(edge: G.EdgeT, simple: Boolean): PreCheckResult
This pre-check must return
Abort
if the subtraction ofedge
is to be canceled,PostCheck
ifpostSubtract
is to be called to decide orComplete
if the theedge
is allowed to be subtracted.This pre-check must return
Abort
if the subtraction ofedge
is to be canceled,PostCheck
ifpostSubtract
is to be called to decide orComplete
if the theedge
is allowed to be subtracted. This pre-check may be omitted by letting it always returnpostCheck
and overriding the corresponding post-checkcommit*
method. Useself
to access the associated graph.- edge
the inner edge to be subtracted.
- simple
true
for standard (edge-only by-
),false
for ripple (by-!
) removal.- returns
The results of the pre-check containing the follow-up activity and possibly any intermediate computation result to be used during the post-check. To add computation results
PreCheckResult
must be extended.
- Definition Classes
- Connected → ConstraintMethods
- def preSubtract(node: G.NodeT, forced: Boolean): PreCheckResult
This pre-check must return
Abort
if the subtraction ofnode
is to be canceled,PostCheck
ifpostSubtract
is to be called to decide orComplete
if the thenode
is allowed to be subtracted.This pre-check must return
Abort
if the subtraction ofnode
is to be canceled,PostCheck
ifpostSubtract
is to be called to decide orComplete
if the thenode
is allowed to be subtracted. This pre-check may be omitted by letting it always returnpostCheck
and overriding the corresponding post-checkcommit*
method. Useself
to access the associated graph.- node
the inner to be subtracted.
- forced
true
for standard (ripple by-
),false
for gentle (by-?
) removal.- returns
The results of the pre-check containing the follow-up activity and possibly any intermediate computation result to be used during the post-check. To add computation results
PreCheckResult
must be extended.
- Definition Classes
- Connected → ConstraintMethods
- def productElementNames: Iterator[String]
- val self: G
When extending
Constraint
,self
will denote the attached constrained graph.When extending
Constraint
,self
will denote the attached constrained graph. The factory methods of the companion objectscalax.collection.constrained.Graph
initializeself
to the correct graph instance. When extendingConstrained
,self
will denotethis
graph.- Definition Classes
- Connected → Constraint → ConstraintMethods
- def stringPrefix: String
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tap[U](f: (Connected[N, E, G]) => U): Connected[N, E, G]
- Implicit
- This member is added by an implicit conversion from Connected[N, E, G] toChainingOps[Connected[N, E, G]] performed by method ChainingOps in scalax.collection.
- Definition Classes
- ChainingOps
- def toString(): String
- Definition Classes
- AnyRef → Any
- val value: Connected[N, E, G]
- 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])
- def ||(that: Constraint[N, E, G]): ConstraintBinaryOp[N, E, G]
Creates a new constraint of the type
ConstraintBinaryOp
with pre- and post-check methods each of which returningtrue
if eitherthis
' orother
's corresponding pre- and post-checks returnstrue
.Creates a new constraint of the type
ConstraintBinaryOp
with pre- and post-check methods each of which returningtrue
if eitherthis
' orother
's corresponding pre- and post-checks returnstrue
.- Definition Classes
- Constraint
- def ~[N >: N1](n2: N): UnDiEdge[N]
- def ~>[N >: N1](n2: N): DiEdge[N]
Shadowed Implicit Value Members
- val self: Connected[N, E, G]
- Implicit
- This member is added by an implicit conversion from Connected[N, E, G] toChainingOps[Connected[N, E, G]] performed by method ChainingOps in scalax.collection.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(connected: ChainingOps[Connected[N, E, G]]).self
- Definition Classes
- ChainingOps
- def toString(): String
- Implicit
- This member is added by an implicit conversion from Connected[N, E, G] toOuterNode[Connected[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Shadowing
- This implicitly inherited member is shadowed by one or more members in this class.
To access this member you can use a type ascription:(connected: OuterNode[Connected[N, E, G]]).toString()
- Definition Classes
- NodeParam → AnyRef → Any
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated @deprecated
- Deprecated
(Since version ) see corresponding Javadoc for more information.
- def →[B](y: B): (Connected[N, E, G], B)
- Implicit
- This member is added by an implicit conversion from Connected[N, E, G] toArrowAssoc[Connected[N, E, G]] 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.