scalaz

Zipper

trait Zipper [+A] extends AnyRef

Provides a pointed stream, which is a non-empty zipper-like stream structure that tracks an index (focus) position in a stream. Focus can be moved forward and backwards through the stream, elements can be inserted before or after the focused position, and the focused item can be deleted.

Based on the pointedlist library by Jeff Wheeler.

Attributes
sealed
Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. Zipper
  2. AnyRef
  3. Any
Visibility
  1. Public
  2. All

Abstract Value Members

  1. val focus : A

    Attributes
    abstract
  2. val lefts : Stream[A]

    Attributes
    abstract
  3. val rights : Stream[A]

    Attributes
    abstract

Concrete Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

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

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def atEnd : Boolean

    Whether the focus is on the last element in the zipper.

  8. def atStart : Boolean

    Whether the focus is on the first element in the zipper.

  9. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  10. def delete : Option[Zipper[A]]

    An alias for deleteRight

  11. def deleteC : Option[Zipper[A]]

    An alias for deleteRightC

  12. def deleteLeft : Option[Zipper[A]]

    Deletes the element at focus and moves the focus to the left.

    Deletes the element at focus and moves the focus to the left. If there is no element on the left, focus is moved to the right.

  13. def deleteLeftC : Option[Zipper[A]]

    Deletes the focused element and moves focus to the left.

    Deletes the focused element and moves focus to the left. If the focus was on the first element, focus is moved to the last element.

  14. def deleteOthers : Zipper[A]

    Deletes all elements except the focused element.

  15. def deleteRight : Option[Zipper[A]]

    Deletes the element at focus and moves the focus to the right.

    Deletes the element at focus and moves the focus to the right. If there is no element on the right, focus is moved to the left.

  16. def deleteRightC : Option[Zipper[A]]

    Deletes the focused element and moves focus to the right.

    Deletes the focused element and moves focus to the right. If the focus was on the last element, focus is moved to the first element.

  17. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  18. def equals (arg0: Any): Boolean

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

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  20. def findBy [AA >: A] (f: (Zipper[AA]) ⇒ Option[Zipper[AA]])(p: (AA) ⇒ Boolean): Option[Zipper[AA]]

    Given a traversal function, find the first element along the traversal that matches a given predicate.

  21. def findNext [AA >: A] (p: (AA) ⇒ Boolean): Option[Zipper[AA]]

    Moves focus to the nearest element on the right that matches the given predicate, or None if there is no such element.

  22. def findPrevious [AA >: A] (p: (AA) ⇒ Boolean): Option[Zipper[AA]]

    Moves focus to the previous element on the left that matches the given predicate, or None if there is no such element.

  23. def findZ (p: (A) ⇒ Boolean): Option[Zipper[A]]

    Moves focus to the nearest element matching the given predicate, preferring the left, or None if no element matches.

  24. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  25. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  26. def index : Int

    The index of the focus.

  27. def insert [AA >: A] : (AA) ⇒ Zipper[AA]

    An alias for insertRight

  28. def insertLeft [AA >: A] (y: AA): Zipper[AA]

    Inserts an element to the left of focus and focuses on the new element.

  29. def insertRight [AA >: A] (y: AA): Zipper[AA]

    Inserts an element to the right of focus and focuses on the new element.

  30. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  31. def length : Int

  32. def move (n: Int): Option[Zipper[A]]

    Moves focus to the nth element of the zipper, or None if there is no such element.

  33. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  34. def next : Option[Zipper[A]]

    Possibly moves to next element to the right of focus.

  35. def nextC : Zipper[A]

    Moves focus to the next element.

    Moves focus to the next element. If the last element is currently focused, loop to the first element.

  36. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  37. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  38. def positions : Zipper[Zipper[A]]

    A zipper of all positions of the zipper, with focus on the current position.

  39. def previous : Option[Zipper[A]]

    Possibly moves to the previous element to the left of focus.

  40. def previousC : Zipper[A]

    Moves focus to the previous element.

    Moves focus to the previous element. If the first element is currently focused, loop to the last element.

  41. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  42. def toStream : Stream[A]

    Get the Stream representation of this Zipper.

    Get the Stream representation of this Zipper. This fully traverses lefts. rights is not evaluated.

  43. def toString (): String

    Definition Classes
    AnyRef → Any
  44. def tryNext : Zipper[A]

    Moves to the next element to the right of focus, or error if there is no element on the right.

  45. def tryPrevious : Zipper[A]

    Moves to the previous element to the left of focus, or error if there is no element on the left.

  46. def wait (): Unit

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

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

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  49. def withFocus : Zipper[(A, Boolean)]

    Pairs each element with a boolean indicating whether that element has focus.

Inherited from AnyRef

Inherited from Any