class Acyclic[N, E[X] <: EdgeLikeIn[X]] extends Constraint[N, E]
Ensures that the underlying Graph is acyclic at any time.
- Alphabetic
- By Inheritance
- Acyclic
- Constraint
- ConstraintHandlerMethods
- ConstraintMethods
- AnyRef
- Any
- by anyToNode
- by CollectionsHaveToParArray
- by EdgeAssoc
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- All
Type Members
-
class
Result extends PreCheckResult
This class makes it possible to carry over nodes that are passed to a pre-check and are already contained in the graph to
postAdd.This class makes it possible to carry over nodes that are passed to a pre-check and are already contained in the graph to
postAdd. Thus we can limit the number of start nodes for cycle detection in the post-check to these passed over docking nodes.- Attributes
- protected
Value Members
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
def
&&(that: Constraint[N, E]): ConstraintBinaryOp[N, E]
Creates a new constraint of the type
ConstraintBinaryOpwith pre- and post-check methods each of which returningtrueif boththis' andthat's corresponding pre- and post-checks returntrue.Creates a new constraint of the type
ConstraintBinaryOpwith pre- and post-check methods each of which returningtrueif boththis' andthat's corresponding pre- and post-checks returntrue.- Definition Classes
- Constraint
- def +(other: String): String
- def ->[B](y: B): (Acyclic[N, E], B)
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
allNodes(passedNodes: Traversable[N], passedEdges: Traversable[E[N]]): Set[N]
Consolidates all outer nodes of the arguments by adding the edge ends of
passedEdgestopassedNodes.Consolidates all outer nodes of the arguments by adding the edge ends of
passedEdgestopassedNodes.- Attributes
- protected
- Definition Classes
- ConstraintMethods
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
- def ensuring(cond: (Acyclic[N, E]) ⇒ Boolean, msg: ⇒ Any): Acyclic[N, E]
- def ensuring(cond: (Acyclic[N, E]) ⇒ Boolean): Acyclic[N, E]
- def ensuring(cond: Boolean, msg: ⇒ Any): Acyclic[N, E]
- def ensuring(cond: Boolean): Acyclic[N, E]
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
- def formatted(fmtstr: String): String
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- 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: Acyclic[N, E]
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
nodesToAdd(passedNodes: Traversable[N], passedEdges: Traversable[E[N]]): Set[N]
- Attributes
- protected
- Definition Classes
- ConstraintMethods
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
def
onAdditionRefused(refusedNodes: Traversable[N], refusedEdges: Traversable[E[N]], graph: Graph[N, E]): Boolean
This handler is called whenever an addition violates the constraints.
This handler is called whenever an addition violates the constraints. The provided default implementation is empty.
- refusedNodes
the nodes passed to
preAdd.- refusedEdges
the edges passed to
preAdd.- returns
must be true if the handler has been overridden but it doesn't throw an exception.
- Definition Classes
- ConstraintHandlerMethods
-
def
onSubtractionRefused(refusedNodes: Traversable[Graph.NodeT], refusedEdges: Traversable[Graph.EdgeT], graph: Graph[N, E]): Boolean
This handler is called whenever a subtraction violates the constraints.
This handler is called whenever a subtraction violates the constraints. The provided default implementation is empty.
- refusedNodes
the nodes passed to
preSubtract.- refusedEdges
the edges passed to
preSubtract.- returns
must be true if the handler has been overridden but it doesn't throw an exception.
- Definition Classes
- ConstraintHandlerMethods
-
def
postAdd(newGraph: Graph[N, E], passedNodes: Traversable[N], passedEdges: Traversable[E[N]], preCheck: PreCheckResult): Boolean
This post-check must return whether
newGraphshould be committed or the add operation is to be rolled back.This post-check must return whether
newGraphshould be committed or the add operation is to be rolled back. Useselfto access the associated graph. For immutable graphs,selfmaintains 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
nodes passed to the running add operation
- passedEdges
edges passed to the running add operation
- preCheck
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
PreCheckResultmust be extended.
- Definition Classes
- Acyclic → ConstraintMethods
-
def
postSubtract(newGraph: Graph[N, E], passedNodes: Traversable[N], passedEdges: Traversable[E[N]], preCheck: PreCheckResult): Boolean
This post-check must return whether
newGraphshould be committed or the subtraction is to be rolled back.This post-check must return whether
newGraphshould be committed or the subtraction is to be rolled back. Useselfto access the associated graph. For immutable graphs,selfmaintains 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.
- preCheck
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
PreCheckResultmust be extended.
- Definition Classes
- ConstraintMethods
-
def
preAdd(elems: InParam[N, E]*): PreCheckResult
If
elemsis relatively small, preventively ensure that there is no cycle within the new elements.If
elemsis relatively small, preventively ensure that there is no cycle within the new elements.- 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
PreCheckResultmust be extended.
- Definition Classes
- Acyclic → ConstraintMethods
-
def
preAdd(edge: E[N]): PreCheckResult
When inserting an edge with a source contained in the graph a cycle is produced if there exists a target node of this edge such that there is a path from the target node to the source node.
When inserting an edge with a source contained in the graph a cycle is produced if there exists a target node of this edge such that there is a path from the target node to the source node.
- 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
PreCheckResultmust be extended.
- Definition Classes
- Acyclic → ConstraintMethods
-
def
preAdd(node: N): PreCheckResult
Adding a single node cannot produce a cycle.
Adding a single node cannot produce a cycle.
- 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
PreCheckResultmust be extended.
- Definition Classes
- Acyclic → ConstraintMethods
-
def
preCreate(nodes: Traversable[N], edges: Traversable[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
nodesandedges. The default implementation callspreAddfor 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
postAddmust 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
PreCheckResultmust be extended.
- Definition Classes
- Acyclic → ConstraintMethods
-
def
preSubtract(nodes: ⇒ Set[Graph.NodeT], edges: ⇒ Set[Graph.EdgeT], simple: Boolean): PreCheckResult
This pre-check must return
Abortif the subtraction ofnodesand/oredgesis to be canceled,PostCheckifpostSubtractis to be called to decide orCompleteifnodesand/oredgesare allowed to be subtracted.This pre-check must return
Abortif the subtraction ofnodesand/oredgesis to be canceled,PostCheckifpostSubtractis to be called to decide orCompleteifnodesand/oredgesare 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. Useselfto 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
truefor standard (edge-only by-),falsefor 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
PreCheckResultmust be extended.
- Definition Classes
- Acyclic → ConstraintMethods
-
def
preSubtract(edge: Graph.EdgeT, forced: Boolean): PreCheckResult
This pre-check must return
Abortif the subtraction ofedgeis to be canceled,PostCheckifpostSubtractis to be called to decide orCompleteif the theedgeis allowed to be subtracted.This pre-check must return
Abortif the subtraction ofedgeis to be canceled,PostCheckifpostSubtractis to be called to decide orCompleteif the theedgeis allowed to be subtracted. This pre-check may be omitted by letting it always returnpostCheckand overriding the corresponding post-checkcommit*method. Useselfto access the associated graph.- edge
the inner edge to be subtracted.
- 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
PreCheckResultmust be extended.
- Definition Classes
- Acyclic → ConstraintMethods
-
def
preSubtract(node: Graph.NodeT, forced: Boolean): PreCheckResult
This pre-check must return
Abortif the subtraction ofnodeis to be canceled,PostCheckifpostSubtractis to be called to decide orCompleteif the thenodeis allowed to be subtracted.This pre-check must return
Abortif the subtraction ofnodeis to be canceled,PostCheckifpostSubtractis to be called to decide orCompleteif the thenodeis allowed to be subtracted. This pre-check may be omitted by letting it always returnpostCheckand overriding the corresponding post-checkcommit*method. Useselfto access the associated graph.- node
the inner to be subtracted.
- forced
truefor standard (ripple by-),falsefor 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
PreCheckResultmust be extended.
- Definition Classes
- Acyclic → ConstraintMethods
-
val
self: Graph[N, E]
When extending
Constraint,selfwill denote the attached constrained graph.When extending
Constraint,selfwill denote the attached constrained graph. The factory methods of the companion objectscalax.collection.constrained.Graphinitializeselfto the correct graph instance. When extendingConstrained,selfwill denotethisgraph.- Definition Classes
- Acyclic → Constraint → ConstraintMethods
- def stringPrefix: String
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toParArray: ParArray[T]
- Implicit
- This member is added by an implicit conversion from Acyclic[N, E] to CollectionsHaveToParArray[Acyclic[N, E], T] performed by method CollectionsHaveToParArray in scala.collection.parallel. This conversion will take place only if an implicit value of type (Acyclic[N, E]) ⇒ GenTraversableOnce[T] is in scope.
- Definition Classes
- CollectionsHaveToParArray
-
def
toString(): String
- Definition Classes
- AnyRef → Any
- val value: Acyclic[N, E]
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
def
||(that: Constraint[N, E]): ConstraintBinaryOp[N, E]
Creates a new constraint of the type
ConstraintBinaryOpwith pre- and post-check methods each of which returningtrueif eitherthis' orother's corresponding pre- and post-checks returnstrue.Creates a new constraint of the type
ConstraintBinaryOpwith pre- and post-check methods each of which returningtrueif 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]
- def →[B](y: B): (Acyclic[N, E], B)
-
object
Result extends PreCheckResultCompanion
- Attributes
- protected
Shadowed Implicit Value Members
-
def
toString(): String
- Implicit
- This member is added by an implicit conversion from Acyclic[N, E] to OuterNode[Acyclic[N, E]] 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:(acyclic: OuterNode[Acyclic[N, E]]).toString()
- Definition Classes
- NodeParam → AnyRef → Any