Packages

t

scalax.collection.constrained

ConstraintMethods

trait ConstraintMethods[N, E[X] <: EdgeLikeIn[X]] extends AnyRef

This template contains all methods that constrained graphs call to decide whether operations altering a mutable graph or operations yielding a new graph from an immutable or mutable graph are valid.

Constraint methods are called on graph creation and node/edge addition and subtraction at two points of time, respectively: prior to the operation and after the operation has taken place but still may be rolled back. Thus, constraint method names are prefixed by pre or post. Pre-ckecks return Abort, PostCheck or Complete while post-checks return Boolean stating whether the operation should be committed or rolled back. Pre-checks can inspect the operands only. In contrast, post-checks additionally allow to inspect the would-be graph after the operation has taken place but has not yet been committed.

For performance reasons, implementations should prefer implementing pre-check methods. If it's necessary to check not only the operands but the whole would-be graph, the appropriate post-check methods should be overridden.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ConstraintMethods
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def preAdd(edge: E[N]): PreCheckResult

    This pre-check must return Abort if the addition is to be canceled, PostCheck if postAdd is to be called to decide or Complete if the outer edge is allowed to be added.

    This pre-check must return Abort if the addition is to be canceled, PostCheck if postAdd is to be called to decide or Complete if the outer edge is allowed to be added. If postAdd has been implemented, this method may always return PostCheck. This pre-check may be omitted by letting it always return postCheck and overriding the corresponding post-check commit* method. Use self 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.

  2. abstract def preAdd(node: N): PreCheckResult

    This pre-check must return Abort if the addition is to be canceled, PostCheck if postAdd is to be called to decide or Complete if the outer node is allowed to be added.

    This pre-check must return Abort if the addition is to be canceled, PostCheck if postAdd is to be called to decide or Complete if the outer node is allowed to be added. If postAdd has been implemented, this method may always return PostCheck. This pre-check may be omitted by letting it always return postCheck and overriding the corresponding post-check commit* method. Use self 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.

  3. abstract def preSubtract(edge: Graph.EdgeT, simple: Boolean): PreCheckResult

    This pre-check must return Abort if the subtraction of edge is to be canceled, PostCheck if postSubtract is to be called to decide or Complete if the the edge is allowed to be subtracted.

    This pre-check must return Abort if the subtraction of edge is to be canceled, PostCheck if postSubtract is to be called to decide or Complete if the the edge is allowed to be subtracted. This pre-check may be omitted by letting it always return postCheck and overriding the corresponding post-check commit* method. Use self 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.

  4. abstract def preSubtract(node: Graph.NodeT, forced: Boolean): PreCheckResult

    This pre-check must return Abort if the subtraction of node is to be canceled, PostCheck if postSubtract is to be called to decide or Complete if the the node is allowed to be subtracted.

    This pre-check must return Abort if the subtraction of node is to be canceled, PostCheck if postSubtract is to be called to decide or Complete if the the node is allowed to be subtracted. This pre-check may be omitted by letting it always return postCheck and overriding the corresponding post-check commit* method. Use self 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.

  5. abstract 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 object scalax.collection.constrained.Graph initialize self to the correct graph instance. When extending Constrained, self will denote this graph.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from ConstraintMethods[N, E] to any2stringadd[ConstraintMethods[N, E]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (ConstraintMethods[N, E], B)
    Implicit
    This member is added by an implicit conversion from ConstraintMethods[N, E] to ArrowAssoc[ConstraintMethods[N, E]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. 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 to passedNodes.

    Consolidates all outer nodes of the arguments by adding the edge ends of passedEdges to passedNodes.

    Attributes
    protected
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  9. def ensuring(cond: (ConstraintMethods[N, E]) ⇒ Boolean, msg: ⇒ Any): ConstraintMethods[N, E]
    Implicit
    This member is added by an implicit conversion from ConstraintMethods[N, E] to Ensuring[ConstraintMethods[N, E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: (ConstraintMethods[N, E]) ⇒ Boolean): ConstraintMethods[N, E]
    Implicit
    This member is added by an implicit conversion from ConstraintMethods[N, E] to Ensuring[ConstraintMethods[N, E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean, msg: ⇒ Any): ConstraintMethods[N, E]
    Implicit
    This member is added by an implicit conversion from ConstraintMethods[N, E] to Ensuring[ConstraintMethods[N, E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. def ensuring(cond: Boolean): ConstraintMethods[N, E]
    Implicit
    This member is added by an implicit conversion from ConstraintMethods[N, E] to Ensuring[ConstraintMethods[N, E]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  13. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  15. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from ConstraintMethods[N, E] to StringFormat[ConstraintMethods[N, E]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  17. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  18. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  21. def nodesToAdd(passedNodes: Traversable[N], passedEdges: Traversable[E[N]]): Set[N]
    Attributes
    protected
  22. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  23. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. 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. Use self 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.

  25. 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. Use self 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.

  26. def preAdd(elems: InParam[N, E]*): PreCheckResult

    This pre-check must return Abort if the addition of the outer nodes and/or edges in elems is to be canceled, PostCheck if postAdd is to be called to decide or Complete 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 in elems is to be canceled, PostCheck if postAdd is to be called to decide or Complete if the the outer nodes and/or edges are allowed to be added. If postAdd has been implemented, this method may always return PostCheck. The default implementation calls preAdd(node)/preAdd(edge) element-wise. As for most cases this won't be satisfactory a domain-specific implementation should be provided. Use self 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.

  27. 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 and edges. The default implementation calls preAdd 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.

  28. def preSubtract(nodes: ⇒ Set[Graph.NodeT], edges: ⇒ Set[Graph.EdgeT], simple: Boolean): PreCheckResult

    This pre-check must return Abort if the subtraction of nodes and/or edges is to be canceled, PostCheck if postSubtract is to be called to decide or Complete if nodes and/or edges are allowed to be subtracted.

    This pre-check must return Abort if the subtraction of nodes and/or edges is to be canceled, PostCheck if postSubtract is to be called to decide or Complete if nodes and/or edges are allowed to be subtracted. It is typically triggered by the -- operation. The default implementation element-wise calls preSubtract(node, simple) or preSubtract(edge, simple), respectively. As for most cases this won't be satisfactory a domain-specific implementation should be provided. Use self 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.

  29. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  30. def toString(): String
    Definition Classes
    AnyRef → Any
  31. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  33. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  34. def [B](y: B): (ConstraintMethods[N, E], B)
    Implicit
    This member is added by an implicit conversion from ConstraintMethods[N, E] to ArrowAssoc[ConstraintMethods[N, E]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from ConstraintMethods[N, E] to any2stringadd[ConstraintMethods[N, E]]

Inherited by implicit conversion StringFormat from ConstraintMethods[N, E] to StringFormat[ConstraintMethods[N, E]]

Inherited by implicit conversion Ensuring from ConstraintMethods[N, E] to Ensuring[ConstraintMethods[N, E]]

Inherited by implicit conversion ArrowAssoc from ConstraintMethods[N, E] to ArrowAssoc[ConstraintMethods[N, E]]

Ungrouped