Record Class STNURTE.NodeWithTimeInterval

java.lang.Object
java.lang.Record
it.univr.di.cstnu.algorithms.STNURTE.NodeWithTimeInterval
All Implemented Interfaces:
Comparable<STNURTE.NodeWithTimeInterval>
Enclosing class:
STNURTE

public static record STNURTE.NodeWithTimeInterval(TimeInterval timeInterval, LabeledNode node) extends Record implements Comparable<STNURTE.NodeWithTimeInterval>
Node with its time window.
  • Constructor Details

    • NodeWithTimeInterval

      public NodeWithTimeInterval(TimeInterval timeInterval, LabeledNode node)
      Creates an instance of a NodeWithTimeInterval record class.
      Parameters:
      timeInterval - the value for the timeInterval record component
      node - the value for the node record component
  • Method Details

    • compareTo

      public int compareTo(STNURTE.NodeWithTimeInterval other)
      Specified by:
      compareTo in interface Comparable<STNURTE.NodeWithTimeInterval>
      Parameters:
      other - other node with time interval
      Returns:
      negative value if this node is alphabetical before other node, 0 if both have the same name, positive value if this node is alphabetical after other node.
    • toString

      public 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.
    • timeInterval

      public TimeInterval timeInterval()
      Returns the value of the timeInterval record component.
      Returns:
      the value of the timeInterval record component
    • node

      public LabeledNode node()
      Returns the value of the node record component.
      Returns:
      the value of the node record component