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
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): (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
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[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
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
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
PreCheckResult
must 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
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.
- 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
PreCheckResult
must be extended.
- Definition Classes
- ConstraintMethods
-
def
preAdd(elems: InParam[N, E]*): PreCheckResult
If
elems
is relatively small, preventively ensure that there is no cycle within the new elements.If
elems
is 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
PreCheckResult
must 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
PreCheckResult
must 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
PreCheckResult
must 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
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
- Acyclic → ConstraintMethods
-
def
preSubtract(nodes: ⇒ Set[Graph.NodeT], edges: ⇒ Set[Graph.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
- Acyclic → ConstraintMethods
-
def
preSubtract(edge: Graph.EdgeT, forced: 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.
- 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
- Acyclic → ConstraintMethods
-
def
preSubtract(node: Graph.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
- Acyclic → ConstraintMethods
-
val
self: Graph[N, E]
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
- 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
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]
- 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