|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--edu.neu.ccs.gui.Interval
Encapsulates an interval of double precision numbers. The endpoints of the interval may be supplied in any order and will be ordered automatically.
| Field Summary | |
protected SwingPropertyChangeSupport |
changeAdapter
Helper object for property change API. |
protected double |
maximum
Upper endpoint of interval. |
protected static String |
MAXIMUM
Bound property name for the maximum property. |
protected double |
midpoint
The midpoint of the interval. |
protected static String |
MIDPOINT
Bound property name for the midpoint property. |
protected double |
minimum
Lower endpoint of interval. |
protected static String |
MINIMUM
Bound property name for the minimum property. |
protected double |
size
Interval size, equal to the difference between the maximum and minimum endpoints. |
protected static String |
SIZE
Bound property name for the size property. |
| Constructor Summary | |
Interval()
Constructs an interval with all data set to 0.0. |
|
Interval(double endpointA,
double endpointB)
Constructs an interval with the given endpoints. |
|
Interval(String data)
Constructs an interval from encoded String data. |
|
| Method Summary | |
void |
addPropertyChangeListener(PropertyChangeListener listener)
Registers the given object to listen for property change events generated by this object. |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Registers the given object to listen for property change events generated by this object with the given property name. |
void |
fromStringData(String data)
Extracts the data state for this Interval object
from a String representation of the data state. |
double |
getMaximum()
Returns the upper endpoint of the interval. |
double |
getMidpoint()
Returns the midpoint of the interval. |
double |
getMinimum()
Returns the lower endpoint of the interval. |
double |
getSize()
Returns the size of the interval, that is, the difference between the upper and lower endpoints. |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Deregisters the given object from listening for property change events generated by this object. |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
Deregisters the given object from listening for property change events generated by this object with the given property name. |
void |
setEndpoints(double endpointA,
double endpointB)
Sets the endpoints for the interval to the given endpoints. |
void |
setInterval(Interval other)
Sets the endpoints for this interval to the endpoints of the given interval. |
String |
toString()
Returns a human readable String representing the
data state of this Interval as: (minimum;maximum). |
String |
toStringData()
Returns a String representation of the data state
for this Interval object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static final String MINIMUM
protected static final String MAXIMUM
protected static final String MIDPOINT
protected static final String SIZE
protected double minimum
protected double maximum
protected double size
protected double midpoint
protected SwingPropertyChangeSupport changeAdapter
| Constructor Detail |
public Interval()
Interval(double, double),
Interval(String)
public Interval(double endpointA,
double endpointB)
endpointA - one of the two endpointsendpointB - the other of the two endpointsInterval(),
Interval(String),
setEndpoints(double, double)
public Interval(String data)
throws ParseException
String data.
data - the encoded String dataInterval(),
Interval(double, double),
toStringData(),
fromStringData(String),
toString()| Method Detail |
public String toStringData()
String representation of the data state
for this Interval object.
toStringData in interface StringableInterval(String),
fromStringData(String),
toString()
public void fromStringData(String data)
throws ParseException
Interval object
from a String representation of the data state.
fromStringData in interface Stringabledata - String representation of the desired value
ParseException - if the data is malformedInterval(String),
toStringData(),
toString()public String toString()
String representing the
data state of this Interval as: (minimum;maximum).
toString in class ObjectInterval(String),
toStringData(),
fromStringData(String)
public void setEndpoints(double endpointA,
double endpointB)
Sets the endpoints for the interval to the given endpoints.
Calling this method may result in the firing
of one or more PropertyChangeEvents.
These events will be fired for property changes
in the following order:
MINIMUM, MAXIMUM,
MIDPOINT, SIZE.
endpointA - one of the two endpointsendpointB - the other of the two endpointssetInterval(Interval)public void setInterval(Interval other)
null,
this method does nothing.
other - the interval to be copiedsetEndpoints(double, double)public double getMinimum()
getMaximum()public double getMaximum()
getMinimum()public double getSize()
public double getMidpoint()
public void addPropertyChangeListener(PropertyChangeListener listener)
listener - the listener to be registered
public void addPropertyChangeListener(String propertyName,
PropertyChangeListener listener)
propertyName - the name of the desired propertylistener - the listener to be registeredpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener - the listener to be deregistered
public void removePropertyChangeListener(String propertyName,
PropertyChangeListener listener)
propertyName - the name of the desired propertylistener - the listener to be deregistered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||