Class FloatInterval

java.lang.Object
org.jacop.floats.core.FloatInterval
All Implemented Interfaces:
Cloneable

public final class FloatInterval extends Object implements Cloneable
Defines interval of numbers which is part of FDV definition which consist of one or several intervals.
Version:
4.8
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final double
    It specifies the maximal value in the interval.
    final double
    It specifies the minimal value in the interval.
  • Constructor Summary

    Constructors
    Constructor
    Description
    It creates the largest possible interval.
    FloatInterval(double min, double max)
    It creates an interval with a given minimum and maximal value.
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    eq(FloatInterval interval)
    It checks equality between intervals.
    double
    max()
    It returns the right bound of the interval (maximum value).
    double
    min()
    It returns the left range of the interval (minimum value).
    boolean
    It checks if an intervals contains only one value (singleton).
    boolean
    singleton(double c)
    It checks if an intervals contains only value c.
     

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • min

      public final double min
      It specifies the minimal value in the interval.
    • max

      public final double max
      It specifies the maximal value in the interval.
  • Constructor Details

    • FloatInterval

      public FloatInterval()
      It creates the largest possible interval.
    • FloatInterval

      public FloatInterval(double min, double max)
      It creates an interval with a given minimum and maximal value.
      Parameters:
      min - the minimal value in the interval (the left bound).
      max - the maximal value in the interval (the right bound).
  • Method Details

    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • eq

      public boolean eq(FloatInterval interval)
      It checks equality between intervals.
      Parameters:
      interval - the inerval to which the comparison is made.
      Returns:
      true if an input interval is equal to this one.
    • max

      public double max()
      It returns the right bound of the interval (maximum value).
      Returns:
      the maximal value from the interval.
    • min

      public double min()
      It returns the left range of the interval (minimum value).
      Returns:
      the minimal value from the interval.
    • singleton

      public boolean singleton()
      It checks if an intervals contains only one value (singleton).
      Returns:
      true if domain has only one value.
    • singleton

      public boolean singleton(double c)
      It checks if an intervals contains only value c.
      Parameters:
      c - integer value to which the singleton is compared to.
      Returns:
      true if variable has a singleton domain and it is equal to value c.
    • toString

      public String toString()
      Overrides:
      toString in class Object