Packages

final case class Cord(self: FingerTree[Int, String]) extends Product with Serializable

A Cord is a purely functional data structure for efficiently storing and manipulating Strings that are potentially very long. Very similar to Rope[Char], but with better constant factors and a simpler interface since it's specialized for Strings.

Source
Cord.scala
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Cord
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Cord(self: FingerTree[Int, String])

Value Members

  1. def ++(xs: Cord): Cord

    Appends another Cord to the end of this one.

    Appends another Cord to the end of this one. Time complexity: O(log (min N M)) where M and N are the lengths of the two Cords.

  2. def +:(x: ⇒ String): Cord

    Prepends a String to the beginning of this Cord.

    Prepends a String to the beginning of this Cord. Time complexity: O(1)

  3. def -:(x: ⇒ Char): Cord

    Prepends a Char to the beginning of this Cord.

    Prepends a Char to the beginning of this Cord. Time complexity: O(1)

  4. def :+(x: ⇒ String): Cord

    Appends a String to the end of this Cord.

    Appends a String to the end of this Cord. Time complexity: O(1)

  5. def :-(x: ⇒ Char): Cord

    Appends a Char to the end of this Cord.

    Appends a Char to the end of this Cord. Time complexity: O(1)

  6. def apply(i: Int): Char

    Returns the character at the given position.

    Returns the character at the given position. Throws an error if the index is out of range. Time complexity: O(log N)

  7. def drop(n: Int): Cord

    Removes the first n characters from the front of this Cord.

    Removes the first n characters from the front of this Cord. Time complexity: O(min N (N - n))

  8. def flatMap(f: (Char) ⇒ Cord): Cord

    Transforms each character to a Cord according to the given function and concatenates them all into one Cord.

  9. def init: Cord

    Removes the last character of this Cord.

    Removes the last character of this Cord. Time complexity: O(1)

  10. def isEmpty: Boolean

    Returns whether this Cord will expand to an empty string.

  11. def length: Int

    Returns the number of characters in this Cord.

    Returns the number of characters in this Cord. Time complexity: O(1)

  12. def map(f: (Char) ⇒ Char): Cord

    Modifies each character in this Cord by the given function.

    Modifies each character in this Cord by the given function. Time complexity: O(N)

  13. def nonEmpty: Boolean

    Returns whether this Cord will expand to a non-empty string.

  14. val self: FingerTree[Int, String]
  15. def size: Int

    Returns the number of characters in this Cord.

    Returns the number of characters in this Cord. Time complexity: O(1)

  16. def split(i: Int): (Cord, Cord)

    Splits this Cord in two at the given position.

    Splits this Cord in two at the given position. Time complexity: O(log N)

  17. def tail: Cord

    Removes the first character of this Cord.

    Removes the first character of this Cord. Time complexity: O(1)

  18. def take(n: Int): Cord

    Returns the first n characters at the front of this Cord.

    Returns the first n characters at the front of this Cord. Time complexity: O(min N (N - n))

  19. def toList: List[Char]
  20. def toStream: Stream[Char]
  21. def toString(): String
    Definition Classes
    Cord → AnyRef → Any
  22. def toVector: Vector[Char]