Record Class FiniteUpperCardinality

java.lang.Object
java.lang.Record
tools.refinery.logic.term.uppercardinality.FiniteUpperCardinality
All Implemented Interfaces:
Comparable<UpperCardinality>, UpperCardinality

public record FiniteUpperCardinality(int finiteUpperBound) extends Record implements UpperCardinality
  • Constructor Details

    • FiniteUpperCardinality

      public FiniteUpperCardinality(int finiteUpperBound)
      Creates an instance of a FiniteUpperCardinality record class.
      Parameters:
      finiteUpperBound - the value for the finiteUpperBound record component
  • Method Details

    • add

      public UpperCardinality add(UpperCardinality other)
      Specified by:
      add in interface UpperCardinality
    • take

      @Nullable public @Nullable UpperCardinality take(int count)
      Specified by:
      take in interface UpperCardinality
    • multiply

      public UpperCardinality multiply(UpperCardinality other)
      Specified by:
      multiply in interface UpperCardinality
    • compareTo

      public int compareTo(@NotNull @NotNull UpperCardinality upperCardinality)
      Specified by:
      compareTo in interface Comparable<UpperCardinality>
    • compareToInt

      public int compareToInt(int value)
      Specified by:
      compareToInt in interface UpperCardinality
    • 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
    • equals

      public 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 '=='.
      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.
    • hashCode

      public 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
    • finiteUpperBound

      public int finiteUpperBound()
      Returns the value of the finiteUpperBound record component.
      Returns:
      the value of the finiteUpperBound record component