final class Slice extends CharSequence with Serializable
Character sequence representing a lazily-calculated substring.
This class has three constructors:
- Slice(s) wraps a string, ensuring that future operations (e.g. subSequence) will construct slices instead of strings.
- Slice(s, start, limit) is the default, and ensures that:
- start >= 0 2. limit >= start 3. limit <= s.length
- Slice.unsafe(s, start, limit) is for situations where the above bounds-checking has already occurred. Only use this if you are absolutely sure your arguments satisfy the above invariants.
Slice's subSequence returns another slice. This means that when wrapping a very large string, garbage collection on the underlying string will not occur until all slices are freed.
Slice's universal equality is only defined with regard to other slices. This means comparing a Slice with other CharSequence values (including String) will always return false.
Slices are serializable. However! They use the default Java serialization layout, which is not that efficient, and could be a disaster in cases where a large shared string might be serialized many times in different slices.
- Annotations
- @SerialVersionUID()
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- Slice
- Serializable
- Serializable
- CharSequence
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- All
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
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
charAt(i: Int): Char
- Definition Classes
- Slice → CharSequence
-
def
chars(): IntStream
- Definition Classes
- CharSequence
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
def
codePoints(): IntStream
- Definition Classes
- CharSequence
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(that: Any): Boolean
- Definition Classes
- Slice → AnyRef → Any
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
-
def
hashCode(): Int
- Definition Classes
- Slice → AnyRef → Any
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
final
val
length: Int
- Definition Classes
- Slice → CharSequence
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
-
def
subSequence(i: Int, j: Int): Slice
- Definition Classes
- Slice → CharSequence
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- Slice → CharSequence → AnyRef → Any
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )