maspack.properties
Class GenericPropertyHandle

java.lang.Object
  extended by maspack.properties.GenericPropertyHandle
All Implemented Interfaces:
Property
Direct Known Subclasses:
InheritablePropertyHandle

public class GenericPropertyHandle
extends java.lang.Object
implements Property


Field Summary
 
Fields inherited from interface maspack.properties.Property
AutoValue, DEFAULT_DOUBLE, IllegalValue, VoidValue
 
Constructor Summary
GenericPropertyHandle(HasProperties host, PropertyDesc desc)
           
 
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 Property.get() is valid.
 void set(java.lang.Object obj)
          Sets the value associated with this property.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericPropertyHandle

public GenericPropertyHandle(HasProperties host,
                             PropertyDesc desc)
Method Detail

getName

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

Specified by:
getName in interface Property
Returns:
name associated with this property

getHost

public HasProperties getHost()
Description copied from interface: Property
Returns the host object exporting this property.

Specified by:
getHost in interface Property
Returns:
host exporting this property

get

public java.lang.Object get()
Description copied from interface: Property
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.

Specified by:
get in interface Property
Returns:
value object
See Also:
Property.getInfo()

set

public void set(java.lang.Object obj)
Description copied from interface: Property
Sets the value associated with this property. This routine will have no effect if the PropertyInfo method isReadOnly returns true.

Specified by:
set in interface Property
Parameters:
obj - object containing the value to be set.
See Also:
Property.getInfo()

getRange

public Range getRange()
Description copied from interface: Property
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 Property.get() is valid.

Specified by:
getRange in interface Property
Returns:
range limits for the property, or null if there are no limits.

getInfo

public PropertyInfo getInfo()
Gets static information about the property.

Specified by:
getInfo in interface Property
Returns:
static property information