|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjgroup.experiment.PropertyDefinition
public class PropertyDefinition
An instance of class PropertyDefinition
contains
information about valid values for a named property.
The constructors of PropertyDefinition
usually take
a property name, the type of property, and the valid values of
the property, as parameters. If the valid values are not given,
all values are valid, as long as they are of the given type.
Valid types are boolean, String, int, Integer and Range,
or an array of these types. The list of valid values is
also passed as an array of one of these types.
Each type is represented by a member constant according to this list:
boolean PropertyDefinition.BOOLEAN_TYPE
String PropertyDefinition.STRING_TYPE
int PropertyDefinition.INT_TYPE
Integer PropertyDefinition.INTEGER_TYPE
Range PropertyDefinition.RANGE_TYPE
Field Summary | |
---|---|
static int |
BOOLEAN_ARRAY_TYPE
|
static int |
BOOLEAN_TYPE
|
static int |
INT_ARRAY_TYPE
|
static int |
INT_TYPE
|
static int |
INTEGER_ARRAY_TYPE
|
static int |
INTEGER_TYPE
|
static int |
RANGE_ARRAY_TYPE
|
static int |
RANGE_TYPE
|
static int |
STRING_ARRAY_TYPE
|
static int |
STRING_TYPE
|
Constructor Summary | |
---|---|
PropertyDefinition(java.lang.String name,
int type)
Creates a PropertyDefinition object with
the specified name and type, with no restrictions on
value. |
|
PropertyDefinition(java.lang.String name,
int type,
int[] values)
Creates a PropertyDefinition object of type
int, with the specified name. |
|
PropertyDefinition(java.lang.String name,
int type,
java.lang.Object[] values)
Creates a PropertyDefinition object with
the specified name and type. |
Method Summary | |
---|---|
java.lang.String |
getPropertyName()
Returns the name of the property as a String. |
int |
getPropertyType()
Returns the type of the property as one of the constants from the list above. |
boolean |
isValid(boolean value)
Returns true if boolean is a valid type for this property, otherwise it returns false. |
boolean |
isValid(int value)
Returns true if the int is a valid type for this property, and has a valid value. |
boolean |
isValid(java.lang.Object value)
Returns true if the value is a valid type for this property, and has a valid value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BOOLEAN_TYPE
public static final int STRING_TYPE
public static final int INT_TYPE
public static final int INTEGER_TYPE
public static final int RANGE_TYPE
public static final int BOOLEAN_ARRAY_TYPE
public static final int STRING_ARRAY_TYPE
public static final int INT_ARRAY_TYPE
public static final int INTEGER_ARRAY_TYPE
public static final int RANGE_ARRAY_TYPE
Constructor Detail |
---|
public PropertyDefinition(java.lang.String name, int type)
PropertyDefinition
object with
the specified name and type, with no restrictions on
value. If the property is of type boolean, only this
constructor can be used. boolean values cannot be
restriced more than the implicit 'true' and 'false'.
type
has to be one of the member constants
listed above.
name
- The name of the propertytype
- The type of the propertypublic PropertyDefinition(java.lang.String name, int type, java.lang.Object[] values)
PropertyDefinition
object with
the specified name and type. The valid values will be
interpreted according to the type of the property.
name
- The name of the propertytype
- The type of the propertyvalidValues
- The valid values of the propertypublic PropertyDefinition(java.lang.String name, int type, int[] values)
PropertyDefinition
object of type
int, with the specified name. The valid values will be
interpreted accordingly.
name
- The name of the propertytype
- The type of the propertyvalidValues
- The valid values of the propertyMethod Detail |
---|
public java.lang.String getPropertyName()
public int getPropertyType()
public boolean isValid(java.lang.Object value)
value
- The value to check.
public boolean isValid(int value)
value
- The value to check.
public boolean isValid(boolean value)
value
- The value to check.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |