Trait

scales.utils.collection.path

Paths

Related Doc: package path

Permalink

trait Paths extends AnyRef

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

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

Type Members

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

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

    Permalink

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. val NotSameRoot: Int

    Permalink
  5. final def asInstanceOf[T0]: T0

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

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

    Permalink

    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.

    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

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

    Permalink

    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.

    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

  9. def comparePathsDirect[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path1: Path[Item, Section, CC], path2: Path[Item, Section, CC]): Boolean

    Permalink

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

  10. def comparePathsP[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](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])

    Permalink
  11. def comparePathsT[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_], 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])

    Permalink
  12. def deepestLast[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path: Path[Item, Section, CC]): Path[Item, Section, CC]

    Permalink

    Deepest last child

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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  16. def foldPositions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](locations: Iterable[Path[Item, Section, CC]])(folder: (Path[Item, Section, CC]) ⇒ FoldOperation[Item, Section, CC])(implicit iseqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC], cm: ClassManifest[(Position[Item, Section, CC], Path[Item, Section, CC])]): FoldR[Item, Section, CC]

    Permalink

    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.

  17. def foldPositions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_], ACC](locations: Iterable[Path[Item, Section, CC]], accumulator: ACC)(folder: (ACC, Path[Item, Section, CC]) ⇒ (ACC, FoldOperation[Item, Section, CC]))(implicit iseqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC], cm: ClassManifest[(Position[Item, Section, CC], Path[Item, Section, CC])]): Either[(ACC, Path[Item, Section, CC]), FoldError]

    Permalink

    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".

  18. def following[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path: Path[Item, Section, CC]): Option[Path[Item, Section, CC]]

    Permalink

    gets the next following:: sibling in document order

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

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

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

    Permalink
    Definition Classes
    Any
  22. def moveTo[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path: Path[Item, Section, CC], newPos: Position[Item, Section, CC])(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]): Path[Item, Section, CC]

    Permalink

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

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

    Permalink
    Definition Classes
    AnyRef
  24. def noPath[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]): Path[Item, Section, CC]

    Permalink
  25. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  27. def positions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](paths: Iterable[Path[Item, Section, CC]]): Iterable[(Position[Item, Section, CC], Path[Item, Section, CC])]

    Permalink

    Obtain the positions for the paths

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

    Permalink

    positions with tuples (T, Path)

  29. def preceding[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path: Path[Item, Section, CC]): Option[Path[Item, Section, CC]]

    Permalink

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

  30. def rootPath[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path: Path[Item, Section, CC]): Path[Item, Section, CC]

    Permalink

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

  31. def sort[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](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]]

    Permalink

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

  32. def sortPositions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](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])]

    Permalink

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

  33. def sortPositionsT[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, 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]))]

    Permalink

    sortPositions with a tuple T, Path

  34. def sortT[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_], 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])]

    Permalink

    sort with a tuple T, Path

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

    Permalink
    Definition Classes
    AnyRef
  36. def toPositionalEqual[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]]: Equal[Path[Item, Section, CC]]

    Permalink

    Provides an instance of the Equal type class for positional Equality

  37. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  38. def top[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](tree: Tree[Item, Section, CC])(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]): Path[Item, Section, CC]

    Permalink
  39. final def wait(): Unit

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

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

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

Inherited from AnyRef

Inherited from Any

Ungrouped