Package com.jidesoft.range
Class LongRange
- java.lang.Object
-
- com.jidesoft.range.AbstractRange<T>
-
- com.jidesoft.range.AbstractNumericRange<java.lang.Long>
-
- com.jidesoft.range.LongRange
-
public class LongRange extends AbstractNumericRange<java.lang.Long>
Specifies upper and lower bounds for a range of values- Author:
- Simon
-
-
Field Summary
Fields Modifier and Type Field Description protected long
_max
protected long
_min
-
Fields inherited from interface com.jidesoft.range.Range
PROPERTY_MAX, PROPERTY_MIN
-
-
Constructor Summary
Constructors Constructor Description LongRange()
Creates a numeric range with minimum 0.0 and maximum of 1.0LongRange(long min, long max)
Create a numeric range by supplying minimum and maximum valuesLongRange(LongRange integerRange)
Constructs a copy of the supplied IntegerRange object
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
adjust(java.lang.Long lower, java.lang.Long upper)
Adjusts the range.boolean
contains(java.lang.Long x)
Determines whether the range contains the supplied valueRange<java.lang.Long>
copy()
Range<java.lang.Long>
createIntermediate(Range<java.lang.Long> targetRange, double position)
boolean
equals(java.lang.Object other)
Test for equality based on the values of min and maxlong
getMax()
long
getMin()
int
hashCode()
java.lang.Long
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(long max)
Sets the maximum valuevoid
setMin(long min)
Sets the minimum valuedouble
size()
Compute the size of the rangejava.lang.String
toString()
java.lang.Long
upper()
-
Methods inherited from class com.jidesoft.range.AbstractRange
addPropertyChangeListener, compareTo, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
LongRange
public LongRange()
Creates a numeric range with minimum 0.0 and maximum of 1.0
-
LongRange
public LongRange(long min, long max)
Create a numeric range by supplying minimum and maximum values- Parameters:
min
- the minimummax
- the maximum
-
LongRange
public LongRange(LongRange integerRange)
Constructs a copy of the supplied IntegerRange object- Parameters:
integerRange
- the long range object to copy
-
-
Method Detail
-
copy
public Range<java.lang.Long> copy()
- Overrides:
copy
in classAbstractRange<java.lang.Long>
-
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 long getMin()
- Returns:
- the minimum value
-
setMin
public void setMin(long min)
Sets the minimum value- Parameters:
min
- the new minimum value.
-
getMax
public long getMax()
- Returns:
- the maximum value
-
setMax
public void setMax(long max)
Sets the maximum value- Parameters:
max
- the new maximum value.
-
adjust
public void adjust(java.lang.Long lower, java.lang.Long upper)
Description copied from interface:Range
Adjusts the range.- Parameters:
lower
- the new smallest value of the rangeupper
- 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 java.lang.Long lower()
- Returns:
- the minimum() value for the range
-
upper
public java.lang.Long upper()
- Returns:
- the maximum() value for the range
-
contains
public boolean contains(java.lang.Long 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<java.lang.Long> createIntermediate(Range<java.lang.Long> targetRange, double position)
- Specified by:
createIntermediate
in classAbstractRange<java.lang.Long>
-
equals
public boolean equals(java.lang.Object other)
Test for equality based on the values of min and max- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-