Package convex.core.data
Class ABlobMap<K extends ABlob,V extends ACell>
java.lang.Object
convex.core.data.AObject
convex.core.data.ACell
convex.core.data.ACountable<E>
convex.core.data.ADataStructure<MapEntry<K,V>>
convex.core.data.AMap<K,V>
convex.core.data.ABlobMap<K,V>
- Type Parameters:
K
- Type of BlobMap keysV
- Type of BlobMap values
- All Implemented Interfaces:
IValidated
,IWriteable
,Map<K,V>
- Direct Known Subclasses:
BlobMap
Abstract base class for a sorted radix-tree map of Blobs to values.
Primary benefits: - Provide sorted orderings for indexes - Support Schedule
data structure
-
Nested Class Summary
-
Field Summary
Fields inherited from class convex.core.data.ADataStructure
count
Fields inherited from class convex.core.data.ACell
cachedRef, EMPTY_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAssociates a blob key with a value in this data structure.boolean
containsKey(ACell key)
Checks if the data structure contains the specified keyDissociates a key from this map, returning an updated map if the key was removed, or the same unchanged map if the key is not present.entryAt(long i)
Gets the entry in this map at a specified index, according to the map-specific order.entrySet()
boolean
equalsKeys(AMap<K,V> map)
Returns true if this map has exactly the same keys as the other mapabstract int
Estimate the encoded data size for this Cell.abstract V
Gets the map entry for a given blobGet the value associated with a given key.Gets the MapEntry for the given keygetKeyRefEntry(Ref<ACell> ref)
Get an entry given a Ref to the key value.getRef(int i)
Gets a numbered child Ref from within this Cell.abstract int
Gets the number of Refs contained within this Cell.getType()
Gets the most specific known runtime Type for this Cell.boolean
Returns true if this Cell is in a canonical format for message writing.Methods inherited from class convex.core.data.AMap
accumulateEntrySet, accumulateKeySet, accumulateValues, assocEntry, clear, conj, containsKey, containsKeyRef, entryVector, equals, equals, filterValues, forEach, get, get, get, getElementRef, getEntryByHash, keySet, print, put, putAll, reduceEntries, reduceValues, remove, values
Methods inherited from class convex.core.data.ACell
announce, announce, attachMemorySize, attachRef, cachedEncoding, cachedHash, calcMemorySize, createAnnounced, createEncoding, createPersisted, createPersisted, createRef, encode, encodeRaw, equals, getChildRefs, getEncoding, getEncodingLength, getHash, getMemorySize, getRef, getTag, hashCode, isCVMValue, isEmbedded, toCanonical, toString, updateRefs, validate, validateCell, write
Methods inherited from class convex.core.data.AObject
attachEncoding, print
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, containsValue, equals, getOrDefault, hashCode, isEmpty, merge, putIfAbsent, remove, replace, replace, replaceAll, size
-
Constructor Details
-
ABlobMap
protected ABlobMap(long count)
-
-
Method Details
-
get
Description copied from class:ADataStructure
Get the value associated with a given key. -
containsKey
Description copied from class:ADataStructure
Checks if the data structure contains the specified key -
get
Gets the map entry for a given blob- Parameters:
key
- Key to lookup up- Returns:
- The value specified by the given blob key or null if not present.
-
equalsKeys
Description copied from class:AMap
Returns true if this map has exactly the same keys as the other map -
entrySet
-
getRefCount
public abstract int getRefCount()Description copied from class:ACell
Gets the number of Refs contained within this Cell. This number is final / immutable for any given instance. Contained Refs may be either external or embedded.- Specified by:
getRefCount
in classACell
- Returns:
- The number of Refs in this Cell
-
getRef
Description copied from class:ACell
Gets a numbered child Ref from within this Cell. -
isCanonical
public boolean isCanonical()Description copied from class:ACell
Returns true if this Cell is in a canonical format for message writing. Reading or writing a non-canonical value should be considered illegal, but non-canonical objects may be used on a temporary internal basis.- Specified by:
isCanonical
in classACell
- Returns:
- true if the object is in canonical format, false otherwise
-
getType
Description copied from class:ACell
Gets the most specific known runtime Type for this Cell. -
assoc
Associates a blob key with a value in this data structure. Returns null if the key is not a valid BlobMap key -
dissoc
Description copied from class:AMap
Dissociates a key from this map, returning an updated map if the key was removed, or the same unchanged map if the key is not present. -
dissoc
-
getKeyRefEntry
Description copied from class:AMap
Get an entry given a Ref to the key value. This is more efficient than directly looking up using the key for some map types, and should be preferred if the caller already has a Ref available. -
entryAt
Description copied from class:AMap
Gets the entry in this map at a specified index, according to the map-specific order. -
getEntry
Description copied from class:AMap
Gets the MapEntry for the given key -
getEntry
-
estimatedEncodingSize
public abstract int estimatedEncodingSize()Description copied from interface:IWriteable
Estimate the encoded data size for this Cell. Used for quickly sizing buffers. Implementations should try to return a size that is likely to contain the entire object when represented in binary format, including the tag byte.- Returns:
- The estimated size for the binary representation of this object.
-