com.jidesoft.range
Class StringRange

java.lang.Object
  extended by com.jidesoft.range.AbstractRange<String>
      extended by com.jidesoft.range.StringRange
All Implemented Interfaces:
Range<String>, Comparable<Range>

public class StringRange
extends AbstractRange<String>


Field Summary
 
Fields inherited from interface com.jidesoft.range.Range
PROPERTY_MAX, PROPERTY_MIN
 
Constructor Summary
StringRange(String lower, String upper)
           
 
Method Summary
 void adjust(String lower, String upper)
          Adjusts the range.
 int compareTo(Range o)
           
 boolean contains(String x)
          Determines whether the supplied point lies within this range.
 Range<String> createIntermediate(Range<String> targetRange, double position)
           
 boolean equals(Object o)
           
 int hashCode()
           
 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(String upper)
           
protected  void setMin(String lower)
           
 double size()
          Compute the size of the range
 String toString()
           
 String upper()
           
 
Methods inherited from class com.jidesoft.range.AbstractRange
addPropertyChangeListener, copy, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StringRange

public StringRange(String lower,
                   String upper)
Method Detail

createIntermediate

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

lower

public String lower()
Returns:
the smallest value of the range

upper

public String upper()
Returns:
the largest value of the range

adjust

public void adjust(String lower,
                   String 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

setMin

protected void setMin(String lower)

setMax

protected void setMax(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(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 the contains() method is more like a set membership test.

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

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Range o)
Specified by:
compareTo in interface Comparable<Range>
Overrides:
compareTo in class AbstractRange<String>


Copyright © 2014. All rights reserved.