Class Values.IntegerInterval

    • Field Summary

      Fields 
      Modifier and Type Field Description
      long inf
      The bounds of the interval.
      long sup
      The bounds of the interval.
    • Constructor Summary

      Constructors 
      Constructor Description
      IntegerInterval​(long singleton)  
      IntegerInterval​(long inf, long sup)
      Builds an IntegerInterval object with the specified bounds.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareContains​(long l)
      Returns 0 if the entity contains the specified value, -1 if the values of the entity are strictly smaller than the specified value, and +1 if the values of the entity are strictly greater than the specified value.
      long greatest()
      Returns the greatest value of the entity (the value itself or the upper bound of the interval).
      boolean isSingleton()
      Returns true iff the entity is an integer value or an integer interval containing only one value
      long smallest()
      Returns the smallest value of the entity (the value itself or the lower bound of the interval).
      String toString()  
      long width()
      Returns the number of values represented by the entity, or -1 if this number does not fit within a long.
    • Field Detail

      • inf

        public final long inf
        The bounds of the interval.
      • sup

        public final long sup
        The bounds of the interval.
    • Constructor Detail

      • IntegerInterval

        public IntegerInterval​(long inf,
                               long sup)
        Builds an IntegerInterval object with the specified bounds.
      • IntegerInterval

        public IntegerInterval​(long singleton)
    • Method Detail

      • isSingleton

        public boolean isSingleton()
        Description copied from interface: Values.IntegerEntity
        Returns true iff the entity is an integer value or an integer interval containing only one value
        Specified by:
        isSingleton in interface Values.IntegerEntity
      • smallest

        public long smallest()
        Description copied from interface: Values.IntegerEntity
        Returns the smallest value of the entity (the value itself or the lower bound of the interval).
        Specified by:
        smallest in interface Values.IntegerEntity
      • greatest

        public long greatest()
        Description copied from interface: Values.IntegerEntity
        Returns the greatest value of the entity (the value itself or the upper bound of the interval).
        Specified by:
        greatest in interface Values.IntegerEntity
      • width

        public long width()
        Description copied from interface: Values.IntegerEntity
        Returns the number of values represented by the entity, or -1 if this number does not fit within a long.
        Specified by:
        width in interface Values.IntegerEntity
      • compareContains

        public int compareContains​(long l)
        Description copied from interface: Values.IntegerEntity
        Returns 0 if the entity contains the specified value, -1 if the values of the entity are strictly smaller than the specified value, and +1 if the values of the entity are strictly greater than the specified value.
        Specified by:
        compareContains in interface Values.IntegerEntity