Package convex.core.data
Class AMapEntry<K extends ACell,V extends ACell>
java.lang.Object
- All Implemented Interfaces:
IAssociative<CVMLong,,ACell> IValidated,IWriteable,Iterable<ACell>,Collection<ACell>,List<ACell>,Map.Entry<K,V>
- Direct Known Subclasses:
MapEntry
-
Field Summary
Fields inherited from class convex.core.data.ADataStructure
countFields inherited from class convex.core.data.ACell
cachedRef, EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanAppends a single element to this vectorappendChunk(VectorLeaf<ACell> listVector) Appends a ListVector chunk to this vector.longComputes the length of the longest common prefix of this vector and another vector.abstract intencode(byte[] bs, int pos) Writes this Cell's encoding to a byte array, including a tag byte which will be written first.voidabstract ACellget(long i) Gets the element at the specified index in this vectorfinal VectorLeaf<ACell>getChunk(long offset) Gets the VectorLeaf chunk at a given offsetabstract KgetKey()getRef(int i) Gets a numbered child Ref from within this Cell.abstract intGets the number of Refs contained within this Cell.abstract VgetValue()abstract booleanReturns true if this vector is in canonical format, i.e.final booleanReturns true if this Vector is a single fully packed tree.iterator()listIterator(long index) Gets the ListIterator for a long positionlongGets the first long index at which the specified value appears in the the sequence.longGets the last long index at which the specified value appears in the the sequence.next()Gets the sequence of all elements after the first, or null if no elements remainfinal ACellfinal Vspliterator(long position) <T> T[]toArray(T[] a) Create a new MapEntry with an updated key.Create a new MapEntry with an updated value.Methods inherited from class convex.core.data.AVector
appendAll, assoc, concat, conj, conjAll, cons, empty, encodeRaw, flatMap, get, getTag, getType, indexOf, isPacked, lastIndexOf, listIterator, map, mergeWith, print, reduce, reverse, slice, spliterator, toArray, updateRefsMethods inherited from class convex.core.data.ASequence
add, addAll, assoc, checkRange, contains, containsKey, get, get, getElementRef, remove, subList, subVector, toCellArray, visitElementRefsMethods inherited from class convex.core.data.ACollection
add, addAll, clear, containsAll, copyToArray, remove, removeAll, retainAll, toVectorMethods inherited from class convex.core.data.ADataStructure
count, isEmpty, size, toCVMStringMethods inherited from class convex.core.data.ACountable
sliceMethods inherited from class convex.core.data.ACell
announce, announce, attachMemorySize, attachRef, cachedEncoding, cachedHash, calcMemorySize, createAnnounced, createEncoding, createPersisted, createPersisted, createRef, equals, equals, getCanonical, getChildRefs, getEncoding, getEncodingLength, getHash, getMemorySize, getRef, hashCode, isCompletelyEncoded, isCVMValue, isEmbedded, mark, mark, toCanonical, toString, validate, validateCell, writeMethods inherited from class convex.core.data.AObject
attachEncoding, print, printMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface convex.core.data.IWriteable
estimatedEncodingSize
-
Constructor Details
-
AMapEntry
public AMapEntry(long count)
-
-
Method Details
-
get
Description copied from class:AVectorGets the element at the specified index in this vector -
appendChunk
Description copied from class:AVectorAppends a ListVector chunk to this vector. This vector must contain a whole number of chunks- Specified by:
appendChunkin classAVector<ACell>- Parameters:
listVector- A chunk to append. Must be a ListVector of maximum size- Returns:
- The updated vector, of the same type as this vector @
-
getChunk
Description copied from class:AVectorGets the VectorLeaf chunk at a given offset -
isFullyPacked
public final boolean isFullyPacked()Description copied from class:AVectorReturns true if this Vector is a single fully packed tree. i.e. a full ListVector or TreeVector.- Specified by:
isFullyPackedin classAVector<ACell>- Returns:
- true if fully packed, false otherwise
-
getRefCount
public abstract int getRefCount()Description copied from class:ACellGets the number of Refs contained within this Cell. This number is final / immutable for any given instance and is defined by the Cell encoding rules. Contained Refs may be either external or embedded.- Specified by:
getRefCountin classACell- Returns:
- The number of Refs in this Cell
-
getRef
Description copied from class:ACellGets a numbered child Ref from within this Cell. -
getKey
-
getValue
-
setValue
-
isCanonical
public abstract boolean isCanonical()Description copied from class:AVectorReturns true if this vector is in canonical format, i.e. suitable as top-level serialised representation of a vector.- Specified by:
isCanonicalin classAVector<ACell>- Returns:
- true if the vector is in canonical format, false otherwise
-
append
Description copied from class:AVectorAppends a single element to this vector -
spliterator
- Specified by:
spliteratorin classAVector<ACell>
-
listIterator
Description copied from class:ASequenceGets the ListIterator for a long position- Specified by:
listIteratorin classAVector<ACell>- Returns:
- ListIterator instance.
-
listIterator
- Specified by:
listIteratorin interfaceList<K extends ACell>
-
iterator
-
longIndexOf
Description copied from class:ASequenceGets the first long index at which the specified value appears in the the sequence. Similar to Java's standard List.indexOf(...) but supports long indexes.- Specified by:
longIndexOfin classASequence<ACell>- Parameters:
o- Any value which could appear as an element of the sequence.- Returns:
- Index of the value, or -1 if not found.
-
longLastIndexOf
Description copied from class:ASequenceGets the last long index at which the specified value appears in the the sequence. Similar to Java's standard List.lastIndexOf(...) but supports long indexes.- Specified by:
longLastIndexOfin classASequence<ACell>- Parameters:
o- Any value which could appear as an element of the sequence.- Returns:
- Index of the value, or -1 if not found.
-
commonPrefixLength
Description copied from class:AVectorComputes the length of the longest common prefix of this vector and another vector.- Specified by:
commonPrefixLengthin classAVector<ACell>- Parameters:
b- Any vector- Returns:
- Length of the longest common prefix
-
withKey
Create a new MapEntry with an updated key. Shares old value. Returns the same MapEntry if unchanged- Parameters:
key- Key to update- Returns:
-
withValue
Create a new MapEntry with an updated value. Shares old key. Returns the same MapEntry if unchanged- Parameters:
value- Value to update- Returns:
-
next
Description copied from class:ASequenceGets the sequence of all elements after the first, or null if no elements remain -
encode
public abstract int encode(byte[] bs, int pos) Description copied from class:ACellWrites this Cell's encoding to a byte array, including a tag byte which will be written first. Cell must be canonical, or else an error may occur.- Specified by:
encodein interfaceIWriteable- Specified by:
encodein classACollection<ACell>- Parameters:
bs- A byte array to which to write the encodingpos- The offset into the byte array- Returns:
- New position after writing
-
set
-
anyMatch
-
allMatch
-
forEach
-
toArray
public <T> T[] toArray(T[] a)
-