Class Construct

java.lang.Object
io.crums.model.hashing.Construct
All Implemented Interfaces:
Entity

public final class Construct
extends java.lang.Object
implements Entity
A well-formed expression. Parser's public implementation of the Entity interface.
  • Method Summary

    Modifier and Type Method Description
    java.nio.ByteBuffer bytes()
    Returns the entity's state as a string of bytes.
    java.lang.String canonicalText()
    Returns toText() in default whitespace formatting.
    boolean delimited()
    Determines if the text representation of the instance is self-delimiting.
    java.lang.String toString()
    Returns toText().
    java.lang.String toText()
    Returns a parseable representation of the entity.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface io.crums.model.hashing.Entity

    bytesHex, equals
  • Method Details

    • delimited

      public boolean delimited()
      Description copied from interface: Entity
      Determines if the text representation of the instance is self-delimiting. This figures when deciding whether to bracket (group) entities in, for example, a binary operation.
      Specified by:
      delimited in interface Entity
    • bytes

      public java.nio.ByteBuffer bytes()
      Description copied from interface: Entity
      Returns the entity's state as a string of bytes. Depending on the entity type, this may involve a computation.
      Specified by:
      bytes in interface Entity
      Returns:
      a read-only view of the instance's bytes.
    • toText

      public java.lang.String toText()
      Returns a parseable representation of the entity. This is just the string the parser read. I.e. formatting is preserved.
      Specified by:
      toText in interface Entity
    • canonicalText

      public java.lang.String canonicalText()
      Returns toText() in default whitespace formatting.
      Returns:
      a single line
    • toString

      public java.lang.String toString()
      Returns toText().
      Overrides:
      toString in class java.lang.Object