scales.utils.collection.path

Paths

trait Paths extends AnyRef

Utility functions for Paths, sorting, moving between Paths, getting to the root etc.

Source
PathFunctions.scala
Linear Supertypes
AnyRef, Any
Known Subclasses
Type Hierarchy Learn more about scaladoc diagrams
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Paths
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type FoldR[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]] = Either[Path[Item, Section, CC], FoldError]

  2. type PathFoldR[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]] = (Path[Item, Section, CC]) ⇒ FoldR[Item, Section, CC]

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. final def ==(arg0: AnyRef): Boolean

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

    Definition Classes
    Any
  6. val NotSameRoot: Int

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def comparePathPositions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path1: Position[Item, Section, CC], path2: Position[Item, Section, CC]): Int

    When paths are not in the same root, they are compared based on the identity hash of the given roots.

    When paths are not in the same root, they are compared based on the identity hash of the given roots. Of course this relies on that function having a decent vm implementation.

    path1
    path2
    returns

    1 if path1 is before path2, -1 if path2 is before path1, 0 if they are the same and NotSameRoot+-1 if they are not in the same root

  10. def comparePaths[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path1: Path[Item, Section, CC], path2: Path[Item, Section, CC]): (Int, Position[Item, Section, CC], Position[Item, Section, CC])

    When paths are not in the same root, they are compared based on the identity hash of the given roots.

    When paths are not in the same root, they are compared based on the identity hash of the given roots. Of course this relies on that function having a decent vm implementation. See http://www.w3.org/TR/2007/REC-xpath20-20070123/#dt-document-order, tree order must remain constant. Its also a pretty sensible approach for non xml trees.

    path1
    path2
    returns

    1 if path1 is before path2, -1 if path2 is before path1, 0 if they are the same and NotSameRoot+-1 if they are not in the same root

  11. def comparePathsDirect[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path1: Path[Item, Section, CC], path2: Path[Item, Section, CC]): Boolean

    Helper for comparePaths, will not evaluate position if the paths are equal

  12. def comparePathsP[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path1: (Position[Item, Section, CC], Path[Item, Section, CC]), path2: (Position[Item, Section, CC], Path[Item, Section, CC])): (Int, Position[Item, Section, CC], Position[Item, Section, CC])

  13. def comparePathsT[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]], T](path1: (Position[Item, Section, CC], (T, Path[Item, Section, CC])), path2: (Position[Item, Section, CC], (T, Path[Item, Section, CC]))): (Int, Position[Item, Section, CC], Position[Item, Section, CC])

  14. def deepestLast[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path: Path[Item, Section, CC]): Path[Item, Section, CC]

    Deepest last child

  15. final def eq(arg0: AnyRef): Boolean

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

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

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  18. def foldPositions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](locations: Iterable[Path[Item, Section, CC]])(folder: (Path[Item, Section, CC]) ⇒ FoldOperation[Item, Section, CC])(implicit cbf: utils.TreeCBF[Item, Section, CC], cm: ClassManifest[(Position[Item, Section, CC], Path[Item, Section, CC])]): FoldR[Item, Section, CC]

    Folds over positions within a single path, for example all given children.

    Folds over positions within a single path, for example all given children. As such positions must be calculated.

    Takes the first root, returning Right(NoSingleRoot) if any of the subsequent roots don't match.

    folder retrieves the current path

    Each iteration folds the resulting tree back into the path. As this function must maintain the Path it does not expose the new path root until the result.

  19. def foldPositions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]], ACC](locations: Iterable[Path[Item, Section, CC]], accumulator: ACC)(folder: (ACC, Path[Item, Section, CC]) ⇒ (ACC, FoldOperation[Item, Section, CC]))(implicit cbf: utils.TreeCBF[Item, Section, CC], cm: ClassManifest[(Position[Item, Section, CC], Path[Item, Section, CC])]): Either[(ACC, Path[Item, Section, CC]), FoldError]

    As per the non accumalating version, folds over positions within a given tree but allows for an additional accumalation.

    As per the non accumalating version, folds over positions within a given tree but allows for an additional accumalation.

    The progress through the document is in reverse document order. This ensures that transformations can always be safely composed, e.g. a delete of a path won't stop changes below it. This, however, implies the developer must also handle any accumulation in "reverse".

  20. def following[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path: Path[Item, Section, CC]): Option[Path[Item, Section, CC]]

    gets the next following:: sibling in document order

  21. final def getClass(): Class[_]

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

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

    Definition Classes
    Any
  24. def moveTo[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path: Path[Item, Section, CC], newPos: Position[Item, Section, CC])(implicit cbf: utils.TreeCBF[Item, Section, CC]): Path[Item, Section, CC]

    Navigates the path until the new position is reached, throws if either its a new root or the position is not reachable

  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. def noPath[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](implicit cbf: utils.TreeCBF[Item, Section, CC]): Path[Item, Section, CC]

  27. final def notify(): Unit

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

    Definition Classes
    AnyRef
  29. def positions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](paths: Iterable[Path[Item, Section, CC]]): Iterable[(Position[Item, Section, CC], Path[Item, Section, CC])]

    Obtain the positions for the paths

  30. def positionsT[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]], T](paths: Iterable[(T, Path[Item, Section, CC])]): Iterable[(Position[Item, Section, CC], (T, Path[Item, Section, CC]))]

    positions with tuples (T, Path)

  31. def preceding[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path: Path[Item, Section, CC]): Option[Path[Item, Section, CC]]

    gets the next preceding:: sibling equivalent in document order, unlike XPath preceding:: it does not exclude parents

  32. def rootPath[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](path: Path[Item, Section, CC]): Path[Item, Section, CC]

    Returns the root path for its input, uses zipUp to ensure changes are kept

  33. def sort[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](paths: Iterable[Path[Item, Section, CC]], isDescending: Boolean = true)(implicit cm: ClassManifest[(Position[Item, Section, CC], Path[Item, Section, CC])]): Iterable[Path[Item, Section, CC]]

    Sorts according to position of each path item, descending or descending based on a depth first then rightwise order.

  34. def sortPositions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](paths: Iterable[Path[Item, Section, CC]], isDescending: Boolean = true)(implicit cm: ClassManifest[(Position[Item, Section, CC], Path[Item, Section, CC])]): Iterable[(Position[Item, Section, CC], Path[Item, Section, CC])]

    Sorts according to position of each path item, descending or descending based on a depth first then rightwise order.

  35. def sortPositionsT[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]], T](paths: Iterable[(T, Path[Item, Section, CC])], isDescending: Boolean = true)(implicit cm: ClassManifest[(Position[Item, Section, CC], (T, Path[Item, Section, CC]))]): Iterable[(Position[Item, Section, CC], (T, Path[Item, Section, CC]))]

    sortPositions with a tuple T, Path

  36. def sortT[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]], T](paths: Iterable[(T, Path[Item, Section, CC])], isDescending: Boolean = true)(implicit cm: ClassManifest[(Position[Item, Section, CC], (T, Path[Item, Section, CC]))]): Iterable[(T, Path[Item, Section, CC])]

    sort with a tuple T, Path

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

    Definition Classes
    AnyRef
  38. def toPositionalEqual[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]]: Equal[Path[Item, Section, CC]]

    Provides an instance of the Equal type class for positional Equality

  39. def toString(): String

    Definition Classes
    AnyRef → Any
  40. def top[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[X] <: IndexedSeqLike[X, CC[X]]](tree: Tree[Item, Section, CC])(implicit cbf: utils.TreeCBF[Item, Section, CC]): Path[Item, Section, CC]

  41. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped