|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.neu.ccs.XInterval
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 | |
private static String[] |
BLANK
The data array with blank names "", "". |
protected SwingPropertyChangeSupport |
changeAdapter
Helper object for property change API. |
protected double |
maximum
Upper endpoint of interval. |
private static String[] |
MAXMIN
The data array with names "max", "min". |
protected double |
minimum
Lower endpoint of interval. |
private static String[] |
MINMAX
The data array with names "min", "max". |
static String |
standardMessage
The standard error message for fromStringData. |
| Fields inherited from interface edu.neu.ccs.util.JPTConstants |
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Constructor Summary | |
XInterval()
Constructs an interval with the endpoints set to 0,0. |
|
XInterval(double endpointA,
double endpointB)
Constructs an interval with the given endpoints. |
|
XInterval(String data)
Constructs an interval from the encoded String data. |
|
XInterval(XInterval interval)
Constructs an XInterval using the given
XInterval. |
|
| 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)
Defines the data state for this XInterval 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(XInterval interval)
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 XInterval as an annotated
string. |
String |
toStringData()
Returns a human readable String representing
the data state of this XInterval as a simple
string. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private static String[] BLANK
private static String[] MINMAX
private static String[] MAXMIN
public static final String standardMessage
protected double minimum
protected double maximum
protected SwingPropertyChangeSupport changeAdapter
| Constructor Detail |
public XInterval()
public XInterval(XInterval interval)
XInterval using the given
XInterval.
interval - the interval to be copied
public XInterval(double endpointA,
double endpointB)
Constructs an interval with the given endpoints.
The order of the endpoints does not matter since the endpoints will be ordered internally.
endpointA - one of the two endpointsendpointB - the other of the two endpoints
public XInterval(String data)
throws ParseException
String data.
data - the encoded String data| Method Detail |
public String toString()
Returns a human readable String representing
the data state of this XInterval as an annotated
string.
XInterval[min=...;max=...]
where ... stands for the minimum and maximum of the interval.
public String toStringData()
Returns a human readable String representing
the data state of this XInterval as a simple
string.
[...;...]
where ... stands for the minimum and maximum of the interval.
toStringData in interface StringableStringable.fromStringData(String)
public void fromStringData(String data)
throws ParseException
Defines the data state for this XInterval object
from a String representation of the data state.
Fires property change VALUE.
fromStringData in interface Stringabledata - String representation of the data state
ParseException - if the data is malformedStringable.toStringData()
public void setEndpoints(double endpointA,
double endpointB)
Sets the endpoints for the interval to the given endpoints.
The order of the endpoints does not matter since the endpoints will be ordered internally.
Fires property change VALUE.
endpointA - one of the two endpointsendpointB - the other of the two endpointspublic void setInterval(XInterval interval)
Sets the endpoints for this interval to the endpoints of the given interval.
Does nothing if the given interval is null.
Fires property change VALUE.
interval - the interval to be copiedpublic double getMinimum()
public double getMaximum()
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 | |||||||||