trait Constrained[N, E[X] <: EdgeLikeIn[X]] extends ConstraintMethods[N, E] with ConstraintHandlerMethods[N, E]
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
 - ConstraintHandlerMethods
 - ConstraintMethods
 - AnyRef
 - Any
 
- by anyToNode
 - by CollectionsHaveToParArray
 - by EdgeAssoc
 - by any2stringadd
 - by StringFormat
 - by Ensuring
 - by ArrowAssoc
 
- Hide All
 - Show All
 
- Public
 - All
 
Abstract Value Members
- 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        preAdd(edge: E[N]): PreCheckResult
      
      
      
This pre-check must return
Abortif the addition is to be canceled,PostCheckifpostAddis to be called to decide orCompleteif the outeredgeis allowed to be added.This pre-check must return
Abortif the addition is to be canceled,PostCheckifpostAddis to be called to decide orCompleteif the outeredgeis allowed to be added. IfpostAddhas been implemented, this method may always returnPostCheck. This pre-check may be omitted by letting it always returnpostCheckand overriding the corresponding post-checkcommit*method. Useselfto 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
PreCheckResultmust be extended.
- Definition Classes
 - ConstraintMethods
 
 - 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        preAdd(node: N): PreCheckResult
      
      
      
This pre-check must return
Abortif the addition is to be canceled,PostCheckifpostAddis to be called to decide orCompleteif the outernodeis allowed to be added.This pre-check must return
Abortif the addition is to be canceled,PostCheckifpostAddis to be called to decide orCompleteif the outernodeis allowed to be added. IfpostAddhas been implemented, this method may always returnPostCheck. This pre-check may be omitted by letting it always returnpostCheckand overriding the corresponding post-checkcommit*method. Useselfto 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
PreCheckResultmust be extended.
- Definition Classes
 - ConstraintMethods
 
 - 
      
      
      
        
      
    
      
        abstract 
        def
      
      
        preSubtract(edge: Graph.EdgeT, simple: 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.
- 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
 - ConstraintMethods
 
 - 
      
      
      
        
      
    
      
        abstract 
        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
 - ConstraintMethods
 
 - 
      
      
      
        
      
    
      
        abstract 
        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
 - 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] to any2stringadd[Constrained[N, E]] performed by method any2stringadd in scala.Predef.
 - Definition Classes
 - any2stringadd
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        ->[B](y: B): (Constrained[N, E], B)
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to ArrowAssoc[Constrained[N, E]] performed by method ArrowAssoc in scala.Predef.
 - Definition Classes
 - ArrowAssoc
 - Annotations
 - @inline()
 
 - 
      
      
      
        
      
    
      
        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: (Constrained[N, E]) ⇒ Boolean, msg: ⇒ Any): Constrained[N, E]
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to Ensuring[Constrained[N, E]] performed by method Ensuring in scala.Predef.
 - Definition Classes
 - Ensuring
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        ensuring(cond: (Constrained[N, E]) ⇒ Boolean): Constrained[N, E]
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to Ensuring[Constrained[N, E]] performed by method Ensuring in scala.Predef.
 - Definition Classes
 - Ensuring
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        ensuring(cond: Boolean, msg: ⇒ Any): Constrained[N, E]
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to Ensuring[Constrained[N, E]] performed by method Ensuring in scala.Predef.
 - Definition Classes
 - Ensuring
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        ensuring(cond: Boolean): Constrained[N, E]
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to Ensuring[Constrained[N, E]] performed by method Ensuring in scala.Predef.
 - Definition Classes
 - Ensuring
 
 - 
      
      
      
        
      
    
      
        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
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to StringFormat[Constrained[N, E]] performed by method StringFormat in scala.Predef.
 - Definition Classes
 - StringFormat
 - Annotations
 - @inline()
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        getClass(): Class[_]
      
      
      
- Definition Classes
 - AnyRef → Any
 - Annotations
 - @native()
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        hashCode(): Int
      
      
      
- Definition Classes
 - AnyRef → Any
 - Annotations
 - @native()
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        isDefined: Boolean
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to OuterNode[Constrained[N, E]] 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] to OuterNode[Constrained[N, E]] 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] to OuterNode[Constrained[N, E]] 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] to OuterNode[Constrained[N, E]] 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] to OuterNode[Constrained[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
 - Definition Classes
 - Param
 
 - 
      
      
      
        
      
    
      
        
        val
      
      
        n1: Constrained[N, E]
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to EdgeAssoc[Constrained[N, E]] performed by method EdgeAssoc in scalax.collection.GraphPredef.
 - Definition Classes
 - EdgeAssoc
 
 - 
      
      
      
        
      
    
      
        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
 - 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
      
      
      
This pre-check must return
Abortif the addition of the outer nodes and/or edges inelemsis to be canceled,PostCheckifpostAddis to be called to decide orCompleteif the the outer nodes and/or edges are allowed to be added.This pre-check must return
Abortif the addition of the outer nodes and/or edges inelemsis to be canceled,PostCheckifpostAddis to be called to decide orCompleteif the the outer nodes and/or edges are allowed to be added. IfpostAddhas 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. Useselfto 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
PreCheckResultmust be extended.
- Definition Classes
 - 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
 - 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
 - ConstraintMethods
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        stringPrefix: String
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to OuterNode[Constrained[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
 - Definition Classes
 - NodeParam
 
 - 
      
      
      
        
      
    
      
        final 
        def
      
      
        synchronized[T0](arg0: ⇒ T0): T0
      
      
      
- Definition Classes
 - AnyRef
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        toParArray: ParArray[T]
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to CollectionsHaveToParArray[Constrained[N, E], T] performed by method CollectionsHaveToParArray in scala.collection.parallel. This conversion will take place only if an implicit value of type (Constrained[N, E]) ⇒ GenTraversableOnce[T] is in scope.
 - Definition Classes
 - CollectionsHaveToParArray
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        toString(): String
      
      
      
- Definition Classes
 - AnyRef → Any
 
 - 
      
      
      
        
      
    
      
        
        val
      
      
        value: Constrained[N, E]
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to OuterNode[Constrained[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
 - Definition Classes
 - OuterNode → NodeParam
 
 - 
      
      
      
        
      
    
      
        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
      
      
        ~[N >: N1](n2: N): UnDiEdge[N]
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to EdgeAssoc[Constrained[N, E]] 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] to EdgeAssoc[Constrained[N, E]] performed by method EdgeAssoc in scalax.collection.GraphPredef.
 - Definition Classes
 - EdgeAssoc
 - Annotations
 - @inline()
 
 - 
      
      
      
        
      
    
      
        
        def
      
      
        →[B](y: B): (Constrained[N, E], B)
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to ArrowAssoc[Constrained[N, E]] performed by method ArrowAssoc in scala.Predef.
 - Definition Classes
 - ArrowAssoc
 
 
Shadowed Implicit Value Members
- 
      
      
      
        
      
    
      
        
        def
      
      
        toString(): String
      
      
      
- Implicit
 - This member is added by an implicit conversion from Constrained[N, E] to OuterNode[Constrained[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:(constrained: OuterNode[Constrained[N, E]]).toString()
 - Definition Classes
 - NodeParam → AnyRef → Any