fuzzydl

## Class Degree

- java.lang.Object
- - fuzzydl.Degree

- Direct Known Subclasses:
    DegreeExpression, DegreeNumeric, DegreeVariable

      public abstract class Degree
      extends java.lang.Object

  Degree.
  Author:
    Fernando Bobillo

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Degree` | `ONE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Degree()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract Expression` | `addToExpression(Expression expr)` Adds the degree to an expression.
    `abstract Inequation` | `createInequalityWithDegreeRHS(Expression expr, char inequationType)` Gets an inequality of the form (expression, type, degree).
    `abstract boolean` | `equals(Degree d)` Checks if two degrees are equal.
    `static Degree` | `getDegree(java.lang.Double numeric)` Constructor for a numeric degree.
    `static Degree` | `getDegree(Expression expr)` Constructor for an expression degree.
    `static Degree` | `getDegree(Variable variable)` Constructor for a variable degree.
    `abstract boolean` | `isNumeric()` Checks if the object is a numeric degree.
    `abstract Expression` | `multiplyConstant(java.lang.Double constant)` Multiplies the degree and a real number.
    `abstract Expression` | `subtractFromExpression(Expression expr)` Subtracts the degree to an expression.
    `abstract java.lang.String` | `toString()` Gets the name of the degree.

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### ONE

          public static final Degree ONE

  - ### Constructor Detail

    - #### Degree

          public Degree()

  - ### Method Detail

    - #### getDegree

          public static Degree getDegree(java.lang.Double numeric)

      Constructor for a numeric degree.
      Parameters:
        `numeric` - A double number in [0,1].
      Returns:
        A numeric degree.

    - #### getDegree

          public static Degree getDegree(Variable variable)

      Constructor for a variable degree.
      Parameters:
        `variable` - A variable.
      Returns:
        A variable degree.

    - #### getDegree

          public static Degree getDegree(Expression expr)

      Constructor for an expression degree.
      Parameters:
        `expr` - An expression.
      Returns:
        A expression degree.

    - #### isNumeric

          public abstract boolean isNumeric()

      Checks if the object is a numeric degree.
      Returns:
        true if the object is a numeric degree; false otherwise.

    - #### createInequalityWithDegreeRHS

          public abstract Inequation createInequalityWithDegreeRHS(Expression expr,
                                                                   char inequationType)

      Gets an inequality of the form (expression, type, degree).
      Parameters:
        `expr` - An expression.
        `inequationType` - A type of inequality.
      Returns:
        An inequality of the form (expression, type, degree).

    - #### addToExpression

          public abstract Expression addToExpression(Expression expr)

      Adds the degree to an expression.
      Parameters:
        `expr` - An expression.
      Returns:
        A new expression with the sum.

    - #### subtractFromExpression

          public abstract Expression subtractFromExpression(Expression expr)

      Subtracts the degree to an expression.
      Parameters:
        `expr` - An expression.
      Returns:
        A new expression with the subtraction expr - this.

    - #### multiplyConstant

          public abstract Expression multiplyConstant(java.lang.Double constant)

      Multiplies the degree and a real number.
      Parameters:
        `constant` - A real number.
      Returns:
        A new expression with the product.

    - #### toString

          public abstract java.lang.String toString()

      Gets the name of the degree.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        Name of the degree.

    - #### equals

          public abstract boolean equals(Degree d)

      Checks if two degrees are equal.
      Parameters:
        `d` - A degree.
      Returns:
        true if the degrees are equal; false otherwise.