scalax.collection.constrained

Constraint

abstract class Constraint[N, E[X] <: EdgeLikeIn[X]] extends ConstraintMethods[N, E] with ConstraintHandlerMethods[N, E]

Template to be implemented and passed to a dynamically constrained graph class by the user. Note that mutable state will be lost on any operation yielding a new graph. Thus it is essential to either design classes inheriting from Constraint in a pure immutable manner or taking internally care of whether the state has been lost.

See also

ConstraintMethods

Linear Supertypes
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Constraint
  2. ConstraintHandlerMethods
  3. ConstraintMethods
  4. AnyRef
  5. Any
Implicitly
  1. by anyToNode
  2. by EdgeAssoc
  3. by any2stringadd
  4. by any2stringfmt
  5. by any2ArrowAssoc
  6. by any2Ensuring
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Constraint(self: Graph[N, E])

    self

    denotes the attached constrained graph.

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 possible any intermediate computation results to be used during the post-check. To add computation results PreCheckResult must be extended.

    Definition Classes
    ConstraintMethods
  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 possible any intermediate computation results to be used during the post-check. To add computation results PreCheckResult must be extended.

    Definition Classes
    ConstraintMethods
  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 possible any intermediate computation results to be used during the post-check. To add computation results PreCheckResult must be extended.

    Definition Classes
    ConstraintMethods
  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 possible any intermediate computation results to be used during the post-check. To add computation results PreCheckResult must be extended.

    Definition Classes
    ConstraintMethods

Concrete Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. 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 returning true if both this' and that's corresponding pre- and post-checks return true.

  5. def +(other: String): String

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to StringAdd performed by method any2stringadd in scala.Predef.
    Definition Classes
    StringAdd
  6. def ->[B](y: B): (Constraint[N, E], B)

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to ArrowAssoc[Constraint[N, E]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  7. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  8. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  9. def allNodes(innerNodes: Set[Graph.NodeT], innerEdges: Set[Graph.EdgeT]): Set[Graph.NodeT]

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

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

    Attributes
    protected
    Definition Classes
    ConstraintMethods
  10. 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 to passedNodes.

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

    Attributes
    protected
    Definition Classes
    ConstraintMethods
  11. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  12. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  13. def ensuring(cond: (Constraint[N, E]) ⇒ Boolean, msg: ⇒ Any): Constraint[N, E]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to Ensuring[Constraint[N, E]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  14. def ensuring(cond: (Constraint[N, E]) ⇒ Boolean): Constraint[N, E]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to Ensuring[Constraint[N, E]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  15. def ensuring(cond: Boolean, msg: ⇒ Any): Constraint[N, E]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to Ensuring[Constraint[N, E]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  16. def ensuring(cond: Boolean): Constraint[N, E]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to Ensuring[Constraint[N, E]] performed by method any2Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  19. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  20. def formatted(fmtstr: String): String

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to StringFormat performed by method any2stringfmt in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @inline()
  21. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  22. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  23. def isDefined: Boolean

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to OuterNode[Constraint[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
    Definition Classes
    Param
  24. def isEdge: Boolean

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to OuterNode[Constraint[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
    Definition Classes
    NodeParam
  25. def isIn: Boolean

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to OuterNode[Constraint[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
    Definition Classes
    InParam → Param
  26. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  27. def isNode: Boolean

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to OuterNode[Constraint[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
    Definition Classes
    NodeParam
  28. def isOut: Boolean

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to OuterNode[Constraint[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
    Definition Classes
    InParam → Param
  29. val n1: Constraint[N, E]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to EdgeAssoc[Constraint[N, E]] performed by method EdgeAssoc in scalax.collection.GraphPredef.
    Definition Classes
    EdgeAssoc
  30. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  31. final def notify(): Unit

    Definition Classes
    AnyRef
  32. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  33. def onAdditionRefused(refusedNodes: Iterable[N], refusedEdges: Iterable[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
  34. def onSubtractionRefused(refusedNodes: Iterable[Graph.NodeT], refusedEdges: Iterable[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
  35. def postAdd(newGraph: Graph[N, E], passedNodes: Iterable[N], passedEdges: Iterable[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 except those coming from node/edge input streams.

    passedEdges

    edges passed to the running add operation except those coming from edge input streams.

    Definition Classes
    ConstraintMethods
  36. def postSubtract(newGraph: Graph[N, E], passedNodes: Iterable[N], passedEdges: Iterable[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.

    Definition Classes
    ConstraintMethods
  37. 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 possible any intermediate computation results to be used during the post-check. To add computation results PreCheckResult must be extended.

    Definition Classes
    ConstraintMethods
  38. 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 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 possible any intermediate computation results to be used during the post-check. To add computation results PreCheckResult must be extended.

    Definition Classes
    ConstraintMethods
  39. 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 possible any intermediate computation results to be used during the post-check. To add computation results PreCheckResult must be extended.

    Definition Classes
    ConstraintMethods
  40. val self: Graph[N, E]

    denotes the attached constrained graph.

    denotes the attached constrained graph.

    Definition Classes
    ConstraintConstraintMethods
  41. def stringPrefix: String

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to OuterNode[Constraint[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
    Definition Classes
    NodeParam
  42. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  43. def toString(): String

    Definition Classes
    AnyRef → Any
  44. val value: Constraint[N, E]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to OuterNode[Constraint[N, E]] performed by method anyToNode in scalax.collection.GraphPredef.
    Definition Classes
    OuterNode → NodeParam
  45. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  46. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  47. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. 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 returning true if either this' or other's corresponding pre- and post-checks returns true.

  49. def ~[N >: N1, N2 <: N](n2: N2): UnDiEdge[N]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to EdgeAssoc[Constraint[N, E]] performed by method EdgeAssoc in scalax.collection.GraphPredef.
    Definition Classes
    EdgeAssoc
    Annotations
    @inline()
  50. def ~>[N >: N1, N2 <: N](n2: N2): DiEdge[N]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to EdgeAssoc[Constraint[N, E]] performed by method EdgeAssoc in scalax.collection.GraphPredef.
    Definition Classes
    EdgeAssoc
    Annotations
    @inline()
  51. def [B](y: B): (Constraint[N, E], B)

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to ArrowAssoc[Constraint[N, E]] performed by method any2ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Shadowed Implicit Value Members

  1. val self: Any

    denotes the attached constrained graph.

    denotes the attached constrained graph.

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to StringAdd performed by method any2stringadd in scala.Predef.
    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:
    (constraint: StringAdd).self
    Definition Classes
    StringAdd
  2. val self: Any

    denotes the attached constrained graph.

    denotes the attached constrained graph.

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to StringFormat performed by method any2stringfmt in scala.Predef.
    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:
    (constraint: StringFormat).self
    Definition Classes
    StringFormat
  3. def toString(): String

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to OuterNode[Constraint[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:
    (constraint: OuterNode[Constraint[N, E]]).toString()
    Definition Classes
    NodeParam → AnyRef → Any

Deprecated Value Members

  1. def x: Constraint[N, E]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to ArrowAssoc[Constraint[N, E]] performed by method any2ArrowAssoc in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (constraint: ArrowAssoc[Constraint[N, E]]).x
    Definition Classes
    ArrowAssoc
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use leftOfArrow instead

  2. def x: Constraint[N, E]

    Implicit information
    This member is added by an implicit conversion from Constraint[N, E] to Ensuring[Constraint[N, E]] performed by method any2Ensuring in scala.Predef.
    Shadowing
    This implicitly inherited member is ambiguous. One or more implicitly inherited members have similar signatures, so calling this member may produce an ambiguous implicit conversion compiler error.
    To access this member you can use a type ascription:
    (constraint: Ensuring[Constraint[N, E]]).x
    Definition Classes
    Ensuring
    Annotations
    @deprecated
    Deprecated

    (Since version 2.10.0) Use resultOfEnsuring instead

Inherited from ConstraintHandlerMethods[N, E]

Inherited from ConstraintMethods[N, E]

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion anyToNode from Constraint[N, E] to OuterNode[Constraint[N, E]]

Inherited by implicit conversion EdgeAssoc from Constraint[N, E] to EdgeAssoc[Constraint[N, E]]

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

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

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

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

Ungrouped