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 String
s that are potentially very long.
Very similar to Rope[Char]
, but with better constant factors and a
simpler interface since it's specialized for String
s.
- Source
- Cord.scala
- Alphabetic
- By Inheritance
- Cord
- Serializable
- Product
- Equals
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new Cord(self: FingerTree[Int, String])
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- 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 twoCord
s. - def +:(x: => String): Cord
Prepends a
String
to the beginning of thisCord
.Prepends a
String
to the beginning of thisCord
. Time complexity: O(1) - def -:(x: => Char): Cord
Prepends a
Char
to the beginning of thisCord
.Prepends a
Char
to the beginning of thisCord
. Time complexity: O(1) - def :+(x: => String): Cord
Appends a
String
to the end of thisCord
.Appends a
String
to the end of thisCord
. Time complexity: O(1) - def :-(x: => Char): Cord
Appends a
Char
to the end of thisCord
.Appends a
Char
to the end of thisCord
. Time complexity: O(1) - final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- 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)
- 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 drop(n: Int): Cord
Removes the first
n
characters from the front of thisCord
.Removes the first
n
characters from the front of thisCord
. Time complexity: O(min N (N - n)) - final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def flatMap(f: (Char) => Cord): Cord
Transforms each character to a
Cord
according to the given function and concatenates them all into oneCord
. - final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def init: Cord
Removes the last character of this
Cord
.Removes the last character of this
Cord
. Time complexity: O(1) - def isEmpty: Boolean
Returns whether this
Cord
will expand to an empty string. - final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def length: Int
Returns the number of characters in this
Cord
.Returns the number of characters in this
Cord
. Time complexity: O(1) - 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) - final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nonEmpty: Boolean
Returns whether this
Cord
will expand to a non-empty string. - final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- def productElementNames: Iterator[String]
- Definition Classes
- Product
- val self: FingerTree[Int, String]
- def size: Int
Returns the number of characters in this
Cord
.Returns the number of characters in this
Cord
. Time complexity: O(1) - 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) - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def tail: Cord
Removes the first character of this
Cord
.Removes the first character of this
Cord
. Time complexity: O(1) - def take(n: Int): Cord
Returns the first
n
characters at the front of thisCord
.Returns the first
n
characters at the front of thisCord
. Time complexity: O(min N (N - n)) - def toList: List[Char]
- def toStream: Stream[Char]
- def toString(): String
- Definition Classes
- Cord → AnyRef → Any
- def toVector: Vector[Char]
- 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()