Record Class Node

java.lang.Object
java.lang.Record
dev.omnist.document.Node
Record Components:
edges - the ordered list of edges
All Implemented Interfaces:
Document, Target

public record Node(List<Edge> edges) extends Record implements Target, Document
A node in the Document model, consisting of an ordered list of labeled edges (omnist-spec §2.1/§2.2). Edge order is preserved exactly as constructed (invariant D-1). Repeated labels are permitted and preserved as separate edges (invariant D-2). Equality is order-sensitive per invariant D-1 (edge order is data). NOTE: Invariant D-3 ("Order is never a schema constraint") applies later to validation and schema algebra operations (§3/ch.6), not to Node equality or representation.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Node(List<Edge> edges)
    Creates an instance of a Node record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the value of the edges record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Node

      public Node(List<Edge> edges)
      Creates an instance of a Node record class.
      Parameters:
      edges - the value for the edges record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • edges

      public List<Edge> edges()
      Returns the value of the edges record component.
      Returns:
      the value of the edges record component