Package convex.core.data
Class ASymbolic
java.lang.Object
convex.core.data.AObject
convex.core.data.ACell
convex.core.data.ASymbolic
- All Implemented Interfaces:
IValidated
,IWriteable
Abstract based class for symbolic objects (Keywords, Symbols)
-
Field Summary
FieldsFields inherited from class convex.core.data.ACell
cachedRef, EMPTY_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected long
Calculates the Memory Size for this Cell.Creates a new Ref for this CellgetName()
int
hashCode()
Gets the Java hashCode for this cell.boolean
Returns true if this object represents a first class CVM Value.boolean
Determines if this Cell Represents an embedded object.void
Validates the name of this Symbolic valueprotected static boolean
validateName(String name2)
Methods inherited from class convex.core.data.ACell
announce, announce, attachMemorySize, attachRef, cachedEncoding, cachedHash, createAnnounced, createEncoding, createPersisted, createPersisted, encode, encodeRaw, equals, equals, getChildRefs, getEncoding, getEncodingLength, getHash, getMemorySize, getRef, getRef, getRefCount, getTag, getType, isCanonical, mark, mark, toCanonical, toString, updateRefs, validate, write
Methods inherited from class convex.core.data.AObject
attachEncoding, print, print
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface convex.core.data.IWriteable
estimatedEncodingSize
-
Field Details
-
name
-
-
Constructor Details
-
ASymbolic
-
-
Method Details
-
createRef
Description copied from class:ACell
Creates a new Ref for this Cell -
isCVMValue
public final boolean isCVMValue()Description copied from class:ACell
Returns true if this object represents a first class CVM Value. Sub-structural cells that are not themselves first class values should return false. CVM values might not be in a canonical format, e.g. temporary data structures- Specified by:
isCVMValue
in classACell
- Returns:
- true if the object is a CVM Value, false otherwise
-
calcMemorySize
protected long calcMemorySize()Description copied from class:ACell
Calculates the Memory Size for this Cell. Requires any child Refs to be either Direct or of persisted status at minimum, or you might get a MissingDataException- Overrides:
calcMemorySize
in classACell
- Returns:
- Memory Size of this Cell
-
getName
-
validateName
-
isEmbedded
public boolean isEmbedded()Description copied from class:ACell
Determines if this Cell Represents an embedded object. Embedded objects are encoded directly into the encoding of the containing Cell (avoiding the need for a hashed reference). Subclasses should override this if they have a cheap O(1) way to determine if they are embedded or otherwise.- Overrides:
isEmbedded
in classACell
- Returns:
- true if Cell is embedded, false otherwise
-
hashCode
public final int hashCode()Description copied from class:ACell
Gets the Java hashCode for this cell. Must be consistent with equals. Default is the first bytes (big-endian) of the Cell Encoding's hash, since this is consistent with encoding-based equality. However, different Types may provide more efficient hashcodes provided that the usual invariants are preserved -
validateCell
Validates the name of this Symbolic value- Specified by:
validateCell
in classACell
- Throws:
InvalidDataException
- If the Cell is invalid
-