Record Class PredicateImpl

java.lang.Object
java.lang.Record
fr.inria.rules.integraal.model.logicalElements.impl.PredicateImpl
Record Components:
label - the predicate label
arity - the predicate arity
All Implemented Interfaces:
fr.inria.rules.dlgpemodel.api.elems.IPredicate, fr.inria.rules.dlgpemodel.api.sentences.IPrintable, Standardizable, Predicate

public record PredicateImpl(String label, int arity) extends Record implements Predicate
Default implementation of Predicate
Author:
Florent Tornil
  • Constructor Details

    • PredicateImpl

      public PredicateImpl(String label, int arity)
      Constructor with a label and arity
      Parameters:
      label - the string representation
      arity - the number of terms
  • Method Details

    • hashCode

      public int hashCode()
      //////////////////////////////////////////////
      Specified by:
      hashCode in class Record
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • 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
    • getName

      public String getName()
      Specified by:
      getName in interface fr.inria.rules.dlgpemodel.api.elems.IPredicate
    • getArity

      public int getArity()
      Specified by:
      getArity in interface fr.inria.rules.dlgpemodel.api.elems.IPredicate
    • label

      public String label()
      Returns the value of the label record component.
      Specified by:
      label in interface Predicate
      Returns:
      the value of the label record component
    • arity

      public int arity()
      Returns the value of the arity record component.
      Specified by:
      arity in interface Predicate
      Returns:
      the value of the arity record component