Record Class Expression

java.lang.Object
java.lang.Record
dev.pfaff.altargui.ffi.Expression
All Implemented Interfaces:
ToExpression

public record Expression(double constant, List<Term> terms) extends Record implements ToExpression
  • Field Details

  • Constructor Details

    • Expression

      public Expression(double constant, List<Term> terms)
      Creates an instance of a Expression record class.
      Parameters:
      constant - the value for the constant record component
      terms - the value for the terms record component
    • Expression

      public Expression(double constant)
    • Expression

      public Expression(Term... terms)
  • Method Details

    • toExpression

      public Expression toExpression()
      Specified by:
      toExpression in interface ToExpression
    • plus

      public Expression plus(double constant)
      Specified by:
      plus in interface ToExpression
    • plus

      public Expression plus(ToExpression rhs)
      Specified by:
      plus in interface ToExpression
    • minus

      public Expression minus(ToExpression rhs)
      Specified by:
      minus in interface ToExpression
    • plus

      public Expression plus(Query rhs)
      Specified by:
      plus in interface ToExpression
    • minus

      public Expression minus(Query rhs)
      Specified by:
      minus in interface ToExpression
    • plus

      public Expression plus(Term rhs)
      Specified by:
      plus in interface ToExpression
    • minus

      public Expression minus(Term rhs)
      Specified by:
      minus in interface ToExpression
    • plus

      public Expression plus(Expression rhs)
      Specified by:
      plus in interface ToExpression
    • minus

      public Expression minus(Expression rhs)
      Specified by:
      minus in interface ToExpression
    • times

      public Expression times(double rhs)
      Specified by:
      times in interface ToExpression
    • dividedBy

      public Expression dividedBy(double rhs)
      Specified by:
      dividedBy in interface ToExpression
    • negate

      public Expression negate()
      Specified by:
      negate in interface ToExpression
    • 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. 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.
    • constant

      public double constant()
      Returns the value of the constant record component.
      Returns:
      the value of the constant record component
    • terms

      public List<Term> terms()
      Returns the value of the terms record component.
      Returns:
      the value of the terms record component