|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jdesktop.swing.data.MetaData
org.jdesktop.swing.data.NumberMetaData
Class for representing meta-data for a numerical data field which is one of the following types:
NumberMetaData metaData = new NumberMetaData("interestrate",
Float.class, "Interest Rate");
metaData.setMinimum(new Float(4.5));
metaData.setMaximum(new Float(6.8));
Setting a minimum and/or maximum constraint will implicitly cause a range
validator to be added to the meta-data object.
| Field Summary | |
protected boolean |
currency
|
protected Number |
maximum
|
protected Number |
minimum
|
| Fields inherited from class org.jdesktop.swing.data.MetaData |
converter, decodeFormat, encodeFormat, klass, label, maxValueCount, minValueCount, name, pcs, readOnly, validators |
| Constructor Summary | |
NumberMetaData()
Instantiates a meta-data object with a default name "numbervalue" and a default field class equal to java.lang.Integer. |
|
NumberMetaData(String name)
Instantiates a meta-data object with the specified name and a default field class equal to java.lang.Integer. |
|
NumberMetaData(String name,
Class klass)
Instantiates a meta-data object with the specified name and field class. |
|
NumberMetaData(String name,
Class klass,
String label)
Instantiates a meta-data object with the specified name, field class, and label. |
|
| Method Summary | |
Number |
getMaximum()
Gets the meta-data "maximum" property which indicates the maximum value of the associated data field. |
Number |
getMinimum()
Gets the meta-data "minimum" property which indicates the minimum value of the associated data field. |
boolean |
isCurrency()
Gets the meta-data "currency" property which indicates whether this data field represents a currency value. |
void |
setCurrency(boolean currency)
Sets the meta-data "currency" property. |
void |
setMaximum(Number maximum)
Sets the meta-data "maximum" property. |
void |
setMinimum(Number minimum)
Sets the meta-data "minimum" property. |
| Methods inherited from class org.jdesktop.swing.data.MetaData |
addPropertyChangeListener, addValidator, getConverter, getDecodeFormat, getElementClass, getEncodeFormat, getLabel, getMaxValueCount, getMinValueCount, getName, getPropertyChangeListeners, getValidators, isReadOnly, isRequired, removePropertyChangeListener, removeValidator, setConverter, setDecodeFormat, setElementClass, setEncodeFormat, setLabel, setMaxValueCount, setMinValueCount, setName, setReadOnly, setRequired |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected Number minimum
protected Number maximum
protected boolean currency
| Constructor Detail |
public NumberMetaData()
java.lang.Integer.
This provides the no-argument constructor required for JavaBeans.
It is recommended that the program explicitly set a meaningful
"name" property.
public NumberMetaData(String name)
java.lang.Integer.
name - String containing the name of the data field
public NumberMetaData(String name,
Class klass)
name - String containing the name of the data fieldklass - Class indicating type of data field
public NumberMetaData(String name,
Class klass,
String label)
name - String containing the name of the data fieldklass - Class indicating type of data fieldlabel - String containing the user-displayable label for the
data field| Method Detail |
public Number getMinimum()
null, which indicates no minimum.
setMinimum(java.lang.Number)public void setMinimum(Number minimum)
minimum - Number containing the minimum value of the data field.
IllegalArgumentException - if the minimum object's class does
not equal the meta-data's field classgetMinimum()public Number getMaximum()
null, which indicates no maximum.
setMaximum(java.lang.Number)public void setMaximum(Number maximum)
maximum - Number containing the maximum value of the data field.
IllegalArgumentException - if the maximum object's class does
not equal the meta-data's field classgetMaximum()public boolean isCurrency()
false.
setCurrency(boolean)public void setCurrency(boolean currency)
currency - boolean indicating whether the data field represents a currencyisCurrency()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||