Class ASymbolic

All Implemented Interfaces:
IValidated, IWriteable
Direct Known Subclasses:
Keyword, Symbol

public abstract class ASymbolic extends ACell
Abstract based class for symbolic objects (Keywords, Symbols)
  • Field Details

  • Constructor Details

  • Method Details

    • createRef

      protected <R extends ACell> Ref<R> createRef()
      Description copied from class: ACell
      Creates a new Ref for this Cell
      Overrides:
      createRef in class ACell
      Type Parameters:
      R - Type of Cell
      Returns:
      New Ref instance
    • isCVMValue

      public final boolean isCVMValue()
      Description copied from class: ACell
      Returns true if this Cell represents a first class CVM Value. Sub-structural cells that are not themselves first class values should return false, pretty much everything else should return true. Note: CVM values might not be in a canonical format, e.g. temporary data structures
      Specified by:
      isCVMValue in class ACell
      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 class ACell
      Returns:
      Memory Size of this Cell
    • estimatedEncodingSize

      public final 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 highly likely to contain the entire object when encoded, including the tag byte. Should not traverse soft Refs, i.e. must be usable on arbitrary partial data structures
      Returns:
      The estimated size for the binary representation of this object.
    • getName

      public final StringShort getName()
      Gets the name of this symbolic value
      Returns:
      Name as a short CVM String
    • validateName

      protected static boolean validateName(AString name)
    • 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 class ACell
      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
      Overrides:
      hashCode in class ACell
      Returns:
      integer hash code.
    • validateCell

      public abstract void validateCell() throws InvalidDataException
      Validates this Symbolic value
      Specified by:
      validateCell in class ACell
      Throws:
      InvalidDataException - If the symbolic value is invalid