JIDE 3.5.15

com.jidesoft.range
Class IntegerRange

java.lang.Object
  extended by com.jidesoft.range.AbstractRange<T>
      extended by com.jidesoft.range.AbstractNumericRange<Integer>
          extended by com.jidesoft.range.IntegerRange
All Implemented Interfaces:
Range<Integer>

public class IntegerRange
extends AbstractNumericRange<Integer>

Specifies upper and lower bounds for a range of values

Author:
Simon

Field Summary
protected  int _max
           
protected  int _min
           
 
Fields inherited from interface com.jidesoft.range.Range
PROPERTY_MAX, PROPERTY_MIN
 
Constructor Summary
IntegerRange()
          Creates a numeric range with minimum 0.0 and maximum of 1.0
IntegerRange(IntegerRange integerRange)
          Constructs a copy of the supplied IntegerRange object
IntegerRange(int min, int max)
          Create a numeric range by supplying minimum and maximum values
 
Method Summary
 void adjust(Integer lower, Integer upper)
          Adjusts the range.
 boolean contains(Integer x)
          Determines whether the range contains the supplied value
 Range<Integer> copy()
           
 Range<Integer> createIntermediate(Range<Integer> targetRange, double position)
           
 boolean equals(Object other)
          Test for equality based on the values of min and max
 int getMax()
           
 int getMin()
           
 int hashCode()
           
 Integer lower()
           
 double maximum()
          This may be the numeric representation of upper() or it may be rounded up.
 double minimum()
          This may be the numeric representation of lower() or it may be rounded down.
 void setMax(int max)
          Sets the maximum value
 void setMin(int min)
          Sets the minimum value
 double size()
          Compute the size of the range
 String toString()
           
 Integer upper()
           
 
Methods inherited from class com.jidesoft.range.AbstractRange
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_min

protected int _min

_max

protected int _max
Constructor Detail

IntegerRange

public IntegerRange()
Creates a numeric range with minimum 0.0 and maximum of 1.0


IntegerRange

public IntegerRange(int min,
                    int max)
Create a numeric range by supplying minimum and maximum values

Parameters:
min - the minimum
max - the maximum

IntegerRange

public IntegerRange(IntegerRange integerRange)
Constructs a copy of the supplied IntegerRange object

Parameters:
integerRange - the integer range object to copy
Method Detail

copy

public Range<Integer> copy()
Overrides:
copy in class AbstractRange<Integer>

minimum

public double minimum()
Description copied from interface: Range
This may be the numeric representation of lower() or it may be rounded down.

Returns:
the minimum value

maximum

public double maximum()
Description copied from interface: Range
This may be the numeric representation of upper() or it may be rounded up.

Returns:
the maximum value

getMin

public int getMin()
Returns:
the minimum value

setMin

public void setMin(int min)
Sets the minimum value

Parameters:
min - the new minimum value.

getMax

public int getMax()
Returns:
the maximum value

setMax

public void setMax(int max)
Sets the maximum value

Parameters:
max - the new maximum value.

adjust

public void adjust(Integer lower,
                   Integer upper)
Description copied from interface: Range
Adjusts the range.

Parameters:
lower - the new smallest value of the range
upper - the new largest value of the range

size

public double size()
Description copied from interface: Range
Compute the size of the range

Returns:
the size of the range

lower

public Integer lower()
Returns:
the minimum() value for the range

upper

public Integer upper()
Returns:
the maximum() value for the range

contains

public boolean contains(Integer x)
Determines whether the range contains the supplied value

Returns:
a boolean to indicate whether the supplied point lies within the range

createIntermediate

public Range<Integer> createIntermediate(Range<Integer> targetRange,
                                         double position)
Specified by:
createIntermediate in class AbstractRange<Integer>

equals

public boolean equals(Object other)
Test for equality based on the values of min and max

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

JIDE 3.5.15