trait Constrained[N, E[+X] <: EdgeLikeIn[X], +G <: Graph[N, E]] extends ConstraintMethods[N, E, G]
Template to be mixed in by any constrained graph class.
The user of the dynamically constrained class scalax.collection.constrained.Graph
or its mutable counterpart need not to be concerned about this trait because
it has been mixed in there. She only needs to pass the companion object for her Constraint
implementation.
Implementors of statically constrained graph classes have to mix in this trait in their constrained graph implementations.
- See also
ConstraintMethods
- Alphabetic
- By Inheritance
- Constrained
- ConstraintMethods
- AnyRef
- Any
- by ChainingOps
- by EdgeAssoc
- by anyToNode
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def preAdd(edge: E[N]): PreCheckResult
This pre-check must return
Abort
if the addition is to be canceled,PostCheck
ifpostAdd
is to be called to decide orComplete
if the outeredge
is allowed to be added.This pre-check must return
Abort
if the addition is to be canceled,PostCheck
ifpostAdd
is to be called to decide orComplete
if the outeredge
is allowed to be added. IfpostAdd
has been implemented, this method may always returnPostCheck
. 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
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
- ConstraintMethods
- abstract def preAdd(node: N): PreCheckResult
This pre-check must return
Abort
if the addition is to be canceled,PostCheck
ifpostAdd
is to be called to decide orComplete
if the outernode
is allowed to be added.This pre-check must return
Abort
if the addition is to be canceled,PostCheck
ifpostAdd
is to be called to decide orComplete
if the outernode
is allowed to be added. IfpostAdd
has been implemented, this method may always returnPostCheck
. 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
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
- ConstraintMethods
- abstract 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
- ConstraintMethods
- abstract 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
- ConstraintMethods
- abstract 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
- ConstraintMethods
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 Constrained[N, E, G] toany2stringadd[Constrained[N, E, G]] performed by method any2stringadd in scala.Predef.
- Definition Classes
- any2stringadd
- def ->[B](y: B): (Constrained[N, E, G], B)
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toArrowAssoc[Constrained[N, E, G]] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @inline()
- 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: (Constrained[N, E, G]) => Boolean, msg: => Any): Constrained[N, E, G]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toEnsuring[Constrained[N, E, G]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: (Constrained[N, E, G]) => Boolean): Constrained[N, E, G]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toEnsuring[Constrained[N, E, G]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean, msg: => Any): Constrained[N, E, G]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toEnsuring[Constrained[N, E, G]] performed by method Ensuring in scala.Predef.
- Definition Classes
- Ensuring
- def ensuring(cond: Boolean): Constrained[N, E, G]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toEnsuring[Constrained[N, E, G]] 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
- def formatted(fmtstr: String): String
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toStringFormat[Constrained[N, E, G]] performed by method StringFormat in scala.Predef.
- Definition Classes
- StringFormat
- Annotations
- @inline()
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def isDefined: Boolean
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Definition Classes
- Param
- final def isEdge: Boolean
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Definition Classes
- Param
- def isIn: Boolean
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Definition Classes
- InParam → Param
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isNode: Boolean
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Definition Classes
- NodeParam
- final def isOut: Boolean
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Definition Classes
- Param
- val n1: Constrained[N, E, G]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toEdgeAssoc[Constrained[N, E, G]] performed by method EdgeAssoc in scalax.collection.GraphPredef.
- Definition Classes
- EdgeAssoc
- 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: (Constrained[N, E, G]) => B): B
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toChainingOps[Constrained[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]
This post-check must return whether
newGraph
should be committed or the add operation is to be rolled back.This post-check must return whether
newGraph
should be committed or the add operation 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-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
- 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
This pre-check must return
Abort
if the addition of the outer nodes and/or edges inelems
is to be canceled,PostCheck
ifpostAdd
is to be called to decide orComplete
if the the outer nodes and/or edges are allowed to be added.This pre-check must return
Abort
if the addition of the outer nodes and/or edges inelems
is to be canceled,PostCheck
ifpostAdd
is to be called to decide orComplete
if the the outer nodes and/or edges are allowed to be added. IfpostAdd
has been implemented, this method may always returnPostCheck
. The default implementation callspreAdd(node)
/preAdd(edge)
element-wise. As for most cases this won't be satisfactory a domain-specific implementation should be provided. Useself
to access the associated graph.- 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
- ConstraintMethods
- def preCreate(nodes: Iterable[N], edges: Iterable[E[N]]): PreCheckResult
This pre-check is called on constructing a graph through its companion object.
This pre-check is called on constructing a graph through its companion object. It must return whether the graph is allowed to be populated with
nodes
andedges
. The default implementation callspreAdd
for each node and edge.Note that nodes and edges coming from node/edge input streams are not checked. So when utilizing streams the post check
postAdd
must be served.- 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
- 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
- ConstraintMethods
- def productElementNames: Iterator[String]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Definition Classes
- Product
- def stringPrefix: String
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Definition Classes
- NodeParam
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tap[U](f: (Constrained[N, E, G]) => U): Constrained[N, E, G]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toChainingOps[Constrained[N, E, G]] performed by method ChainingOps in scalax.collection.
- Definition Classes
- ChainingOps
- def toString(): String
- Definition Classes
- AnyRef → Any
- val value: Constrained[N, E, G]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[N, E, G]] performed by method anyToNode in scalax.collection.GraphPredef.
- Definition Classes
- OuterNode → NodeParam
- 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 ~[N >: N1](n2: N): UnDiEdge[N]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toEdgeAssoc[Constrained[N, E, G]] performed by method EdgeAssoc in scalax.collection.GraphPredef.
- Definition Classes
- EdgeAssoc
- Annotations
- @inline()
- def ~>[N >: N1](n2: N): DiEdge[N]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toEdgeAssoc[Constrained[N, E, G]] performed by method EdgeAssoc in scalax.collection.GraphPredef.
- Definition Classes
- EdgeAssoc
- Annotations
- @inline()
Shadowed Implicit Value Members
- val self: Constrained[N, E, G]
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toChainingOps[Constrained[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:(constrained: ChainingOps[Constrained[N, E, G]]).self
- Definition Classes
- ChainingOps
- def toString(): String
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toOuterNode[Constrained[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:(constrained: OuterNode[Constrained[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): (Constrained[N, E, G], B)
- Implicit
- This member is added by an implicit conversion from Constrained[N, E, G] toArrowAssoc[Constrained[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.