sealed abstract class Ref2List[+T <: AnyRef] extends Serializable
A growable, immutable linked list based, data store for reference values except null
.
Though this data store is backed by a linked list, it is not a classical linked list and it
does not offer (efficient) head and tail operations. However, compared to a classical linked
list the memory usage is reduced by ~33% and a simple foreach is also ~17% faster, the time
to create the list is comparable and iteration using an Iterator is marginally slower if at all.
The basic idea is to two store 2 values in each node of the linked list to reduce the overhead
incurred by the creation of the objects.
This list does not perform any length related checks. I.e., it fails,e.g., in
case of forFirstN
if the size of the list is smaller than expected.
Furthermore, all directly implemented methods use while
loops for maximum
efficiency and the list is also specialized for primitive unsigned long
values which
makes this list far more efficient when used for storing lists of long
values.
- Self Type
- Ref2List[T]
- Source
- Ref2List.scala
- Alphabetic
- By Inheritance
- Ref2List
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def +:[X >: T <: AnyRef](v: X): Ref2List[X]
Prepends the given value to this list.
Prepends the given value to this list. E.g.,
l = "x" +: l
. - abstract def equals(that: Ref2List[AnyRef]): Boolean
- abstract def forFirstN[U](n: Int)(f: (T) => U): Unit
Iterates over the first N values.
- abstract def foreach[U](f: (T) => U): Unit
- abstract def isEmpty: Boolean
- abstract def isSingletonList: Boolean
- abstract def iterator: Iterator[T]
- returns
An iterator over this list's values. In general, you should prefer using foreach or the other specialized methods to avoid the overhead incurred by the generation of the iterator.
- abstract def nonEmpty: Boolean
Concrete 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 clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @IntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def equals(other: Any): Boolean
- Definition Classes
- Ref2List → AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @IntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @IntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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])
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated