trait Paths extends AnyRef
Utility functions for Paths, sorting, moving between Paths, getting to the root etc.
- Alphabetic
- By Inheritance
- Paths
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Type Members
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- val NotSameRoot: Int
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def comparePathPositions[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](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.
- 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
- 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])
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
- def comparePathsDirect[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path1: Path[Item, Section, CC], path2: Path[Item, Section, CC]): Boolean
Helper for comparePaths, will not evaluate position if the paths are equal
- 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])
- 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])
- def deepestLast[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path: Path[Item, Section, CC]): Path[Item, Section, CC]
Deepest last child
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- 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]
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.
- 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]
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".
- def following[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path: Path[Item, Section, CC]): Option[Path[Item, Section, CC]]
gets the next following:: sibling in document order
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- 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]
Navigates the path until the new position is reached, throws if either its a new root or the position is not reachable
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- 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]
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- 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])]
Obtain the positions for the paths
- 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]))]
positions with tuples (T, Path)
- def preceding[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](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
- def rootPath[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](path: Path[Item, Section, CC]): Path[Item, Section, CC]
Returns the root path for its input, uses zipUp to ensure changes are kept
- 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]]
Sorts according to position of each path item, descending or descending based on a depth first then rightwise order.
- 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])]
Sorts according to position of each path item, descending or descending based on a depth first then rightwise order.
- 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]))]
sortPositions with a tuple T, Path
- 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])]
sort with a tuple T, Path
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toPositionalEqual[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]]: Equal[Path[Item, Section, CC]]
Provides an instance of the Equal type class for positional Equality
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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]
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()