maspack.properties
Interface Property

All Known Subinterfaces:
InheritableProperty, NumericProperty
All Known Implementing Classes:
EditingProperty, GenericPropertyHandle, InheritablePropertyHandle

public interface Property

A handle object used to access values and obtain information for a specific property exported by an object.


Field Summary
static java.lang.Class<?> AutoValue
          Special class type indicating that a value is to be determined automatically.
static double DEFAULT_DOUBLE
          Special value of double that can optionally be used to denote default values.
static java.lang.Class<?> IllegalValue
          Special class type indicating an invalid value.
static java.lang.Class<?> VoidValue
          Special class type indicating no specified value.
 
Method Summary
 java.lang.Object get()
          Returns the value associated with this property.
 HasProperties getHost()
          Returns the host object exporting this property.
 PropertyInfo getInfo()
          Gets static information about the property.
 java.lang.String getName()
          Returns the name associated with this Property.
 Range getRange()
          Returns a range that indicates what values are legal for for this property, or null if the property does not have any range limits (i.e., if any value of appropriate type specified to get() is valid.
 void set(java.lang.Object value)
          Sets the value associated with this property.
 

Field Detail

VoidValue

static final java.lang.Class<?> VoidValue
Special class type indicating no specified value. This is used instead of null since the latter may itself be a valid value.


AutoValue

static final java.lang.Class<?> AutoValue
Special class type indicating that a value is to be determined automatically.


IllegalValue

static final java.lang.Class<?> IllegalValue
Special class type indicating an invalid value.


DEFAULT_DOUBLE

static final double DEFAULT_DOUBLE
Special value of double that can optionally be used to denote default values. Magnitude is large enough that it is unlikely to occur, while also being easy to type into an interface.

See Also:
Constant Field Values
Method Detail

get

java.lang.Object get()
Returns the value associated with this property. By default, the caller should (defensively) assume that this value is returned by reference, and that modifying it will therefore cause changes within the host.

Returns:
value object
See Also:
getInfo()

set

void set(java.lang.Object value)
Sets the value associated with this property. This routine will have no effect if the PropertyInfo method isReadOnly returns true.

Parameters:
value - object containing the value to be set.
See Also:
getInfo()

getRange

Range getRange()
Returns a range that indicates what values are legal for for this property, or null if the property does not have any range limits (i.e., if any value of appropriate type specified to get() is valid.

Returns:
range limits for the property, or null if there are no limits.

getName

java.lang.String getName()
Returns the name associated with this Property. This is a convenience routine, since the name can also be obtained using
 getInfo().getName();
 

Returns:
name associated with this property

getHost

HasProperties getHost()
Returns the host object exporting this property.

Returns:
host exporting this property

getInfo

PropertyInfo getInfo()
Gets static information about the property.

Returns:
static property information