Trait

razie

XpSolver

Related Doc: package razie

Permalink

trait XpSolver[T] extends AnyRef

the strategy to break down the input based on the current path element. The solving algorithm is: apply current sub-path to current sub-nodes, get the results and RESTs. Filter by conditions and recurse.

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. XpSolver
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. abstract type U

    Permalink

    type U stands for the continuation that following methods pass to themselves.

    type U stands for the continuation that following methods pass to themselves.

    Ideally it's just a closure that can implement getNext(curr: (T, U), tag: String, assoc: String): Iterable[(T, U)]

    So options include

    type U = List[MyWrapper] and type U = PartialFunction[(String, String), List[MyWrapper]] // basically getNext (tag, assoc)

    The continuation is very good when getting the kids is expensive, like a DB query, eh?

Abstract Value Members

  1. abstract def children(root: T, xe: Option[XpElement]): (T, U)

    Permalink

    prepare to start from a node, figure out the continuations.

    prepare to start from a node, figure out the continuations.

    This is only used to start, from the root - then getNext is used

    You can return an actual list of nodes or a callback that you then call from getNext to get the actuals

    root

    the node we'll start resolving from

    xe

    - optional the current path element - you can use cond to filter result set directly when querying

  2. abstract def getAttr(curr: T, attr: String): String

    Permalink

    get the value of an attribute from the given node

    get the value of an attribute from the given node

    curr

    the current element

    returns

    the value, toString, of the attribute

  3. abstract def getNext(curr: (T, U), tag: String, assoc: String, xe: Option[XpElement]): Iterable[(T, U)]

    Permalink

    get the next list of nodes at the current position in the path.

    get the next list of nodes at the current position in the path. For each, return a tuple with the respective value and the REST to continue solving

    You can return an actual list of nodes or a callback that you then call from getNext to get the actuals

    curr

    the list of (currelement, continuation) to analyze

    xe

    - optional the current path element - you can use cond to filter result set directly when querying

Concrete Value Members

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

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

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

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. def reduce(curr: Iterable[(T, U)], xe: XpElement): Iterable[(T, U)]

    Permalink

    reduce the current set of possible nodes based on the given condition.

    reduce the current set of possible nodes based on the given condition. Note that the condition may be null - this is still called to give you a chance to cleanup?

    This default implementation may be ok for most resolvers

    NOTE - if you choose to filter in getNext, then you don't have to filter here...

    curr

    the list of (currelement, continuation) to reduce

  16. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  17. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  18. def unwrap(root: List[T]): List[T]

    Permalink

    finally unwrap whatever and serve plain objects

    finally unwrap whatever and serve plain objects

    root

    the node we'll start resolving from

  19. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped