Package com.jidesoft.range
Class StringRange
- java.lang.Object
-
- com.jidesoft.range.AbstractRange<java.lang.String>
-
- com.jidesoft.range.StringRange
-
public class StringRange extends AbstractRange<java.lang.String>
-
-
Field Summary
-
Fields inherited from interface com.jidesoft.range.Range
PROPERTY_MAX, PROPERTY_MIN
-
-
Constructor Summary
Constructors Constructor Description StringRange(java.lang.String lower, java.lang.String upper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
adjust(java.lang.String lower, java.lang.String upper)
Adjusts the range.int
compareTo(Range o)
boolean
contains(java.lang.String x)
Determines whether the supplied point lies within this range.Range<java.lang.String>
createIntermediate(Range<java.lang.String> targetRange, double position)
boolean
equals(java.lang.Object o)
int
hashCode()
java.lang.String
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.protected void
setMax(java.lang.String upper)
protected void
setMin(java.lang.String lower)
double
size()
Compute the size of the rangejava.lang.String
toString()
java.lang.String
upper()
-
Methods inherited from class com.jidesoft.range.AbstractRange
addPropertyChangeListener, copy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener
-
-
-
-
Method Detail
-
createIntermediate
public Range<java.lang.String> createIntermediate(Range<java.lang.String> targetRange, double position)
- Specified by:
createIntermediate
in classAbstractRange<java.lang.String>
-
lower
public java.lang.String lower()
- Returns:
- the smallest value of the range
-
upper
public java.lang.String upper()
- Returns:
- the largest value of the range
-
adjust
public void adjust(java.lang.String lower, java.lang.String 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
-
setMin
protected void setMin(java.lang.String lower)
-
setMax
protected void setMax(java.lang.String upper)
-
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 numeric value of the smallest value to include in the range.
-
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 numeric value of the largest value to include in the range.
-
size
public double size()
Description copied from interface:Range
Compute the size of the range
-
contains
public boolean contains(java.lang.String x)
Description copied from interface:Range
Determines whether the supplied point lies within this range. For continuous ranges this is interpreted as a pair of inequalities on the supplied value (i.e., min <= x <= max), but for discrete ranges thecontains()
method is more like a set membership test.- Returns:
- a boolean to indicate whether the supplied point lies within the range
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(Range o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Range>
- Overrides:
compareTo
in classAbstractRange<java.lang.String>
-
-