Package

scales.utils.collection

path

Permalink

package path

Visibility
  1. Public
  2. All

Type Members

  1. trait AbstractPathIterator[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_], T] extends Iterator[T]

    Permalink

    Provides an Iterator from a given initial path that traverses the entire tree, allows both forwards and backwards iteration.

    Provides an Iterator from a given initial path that traverses the entire tree, allows both forwards and backwards iteration.

    It specifically provides an up event, allowing consumers to "pop" the element stack

  2. case class AddAfter[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](newPath: utils.ItemOrTree[Item, Section, CC])(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]) extends FoldOperation[Item, Section, CC] with Product with Serializable

    Permalink
  3. case class AddBefore[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](newPath: utils.ItemOrTree[Item, Section, CC])(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]) extends FoldOperation[Item, Section, CC] with Product with Serializable

    Permalink
  4. case class AsIs[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]]()(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]) extends FoldOperation[Item, Section, CC] with Product with Serializable

    Permalink

    Use to make it easier to filter out large sets (for those that aren't interesting simply asis them, see tests for use case)

  5. class DirectionIterator[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]] extends AbstractPathIterator[Item, Section, CC, Path[Item, Section, CC]]

    Permalink

    Iterates over paths using the document order it skips over EndElemS events when going forward and StartElem when reversing, returning just the path.

    Iterates over paths using the document order it skips over EndElemS events when going forward and StartElem when reversing, returning just the path. Developers should call preceding or following before entering this iterator.

  6. sealed trait FoldError extends AnyRef

    Permalink
  7. sealed trait FoldOperation[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]] extends AnyRef

    Permalink

    Represents the base for operations that fold over a list of paths

  8. case class Node[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](index: Int, focus: utils.ItemOrTree[Item, Section, CC]) extends Product with Serializable

    Permalink

    Position in a parent Paths children

  9. case class Path[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](top: EitherLike[Top[Item, Section, CC], Path[Item, Section, CC]], node: Node[Item, Section, CC])(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]) extends Iterable[Path[Item, Section, CC]] with RightLike[Top[Item, Section, CC], Path[Item, Section, CC]] with Product with Serializable

    Permalink
  10. class PathFoldCombiner[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]] extends AnyRef

    Permalink

    Provide & combinator to pass the result of one fold onto the other, in the case of failure no further joined functions will be called.

    Provide & combinator to pass the result of one fold onto the other, in the case of failure no further joined functions will be called.

    And provides | which allows NoPaths failures, allowing the use site to decide how to combine

  11. trait PathImplicits extends AnyRef

    Permalink
  12. trait Paths extends AnyRef

    Permalink

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

  13. trait Position[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]] extends AnyRef

    Permalink

    Positions only have meaning for a given Path(s).

    Positions only have meaning for a given Path(s).

    Their internal representation may change, as such its private to Paths.

  14. case class Remove[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]]()(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]) extends FoldOperation[Item, Section, CC] with Product with Serializable

    Permalink
  15. case class Replace[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](replaceWith: Iterable[utils.ItemOrTree[Item, Section, CC]])(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]) extends FoldOperation[Item, Section, CC] with Product with Serializable

    Permalink

    Allows replacing one path with many, may be easier to use the * version however

  16. case class ReplaceWith[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]](f: utils.PathFoldR[Item, Section, CC], wholeTree: Boolean = false)(implicit seqLikeThing: SeqLikeThing[CC[_], utils.ItemOrTree[Item, Section, CC], CC]) extends FoldOperation[Item, Section, CC] with Product with Serializable

    Permalink

    Allows foldPositions to be nested, only replace and delete makes sense here (afaict).

    Allows foldPositions to be nested, only replace and delete makes sense here (afaict).

    As such, when wholeTree is false, the path (which must be a tree) is transformed

    p => top(p.tree)

    and a special case for "deletes" is made - when RemovedRoot is returned from the transformation a delete will take place on the Path. This enforces that only replace and removes are possible and function appropriately.

    Warning:

    When wholeTree is true the function f is passed the Path (or item) in the original tree, any transformations are then conusmed across the whole tree, which is likely not desired.

  17. case class Top[Item <: LeftLike[Item, Tree[Item, Section, CC]], Section, CC[_]]() extends LeftLike[Top[Item, Section, CC], Path[Item, Section, CC]] with Product with Serializable

    Permalink

    Represents the Top for a given Path, there isn't a tree above this

Value Members

  1. object AddedBeforeOrAfterRoot extends FoldError with Product with Serializable

    Permalink
  2. object NoPaths extends FoldError with Product with Serializable

    Permalink
  3. object NoSingleRoot extends FoldError with Product with Serializable

    Permalink
  4. object PathFold

    Permalink
  5. object RemovedRoot extends FoldError with Product with Serializable

    Permalink
  6. object Replace extends Serializable

    Permalink

Ungrouped