Class VectorLeaf<T extends ACell>

java.lang.Object
Type Parameters:
T - Type of vector elements
All Implemented Interfaces:
IAssociative<CVMLong,T>, IValidated, IWriteable, Iterable<T>, Collection<T>, List<T>, SequencedCollection<T>

public class VectorLeaf<T extends ACell> extends AVector<T>
A Persistent Vector implementation representing 0-16 elements with a packed Vector prefix. Design goals:
  • Allows fast access to most recently appended items
  • O(1) append, equals - O(log n) access, update
  • O(log n) comparisons
  • Fast computation of common prefix
Representation in bytes:
  • 0x80 - VectorLeaf tag byte
  • VLC Long - Length of list. Greater than 16 implies prefix must be present. Low 4 bits specify N (0 means 16 in presence of prefix)
  • [Ref]*N - N Elements with length
  • Ref? - Tail Ref (excluded if not present)