artofillusion
Class Property

java.lang.Object
  extended by artofillusion.Property

public class Property
extends java.lang.Object

This class defines an arbitrary property of an object. It specifies the property name, the type of property (numeric, text, boolean, etc.), and the set of allowed values.


Nested Class Summary
static class Property.PropertyType
          Instances of this class represent specific types of properties.
 
Field Summary
static Property.PropertyType BOOLEAN
          A property whose values are represented by Boolean objects.
static Property.PropertyType COLOR
          A property whose values are represented by RGBColor objects.
static Property.PropertyType DOUBLE
          A property whose values are represented by Double objects.
static Property.PropertyType ENUMERATION
          A property whose values must be one of a fixed set of allowed values.
static Property.PropertyType INTEGER
          A property whose values are represented by Integer objects.
static Property.PropertyType STRING
          A property whose values are represented by String objects.
 
Constructor Summary
Property(java.lang.String name, boolean defaultValue)
          Create a Boolean valued property.
Property(java.lang.String name, double min, double max, double defaultValue)
          Create a Double valued property.
Property(java.lang.String name, int min, int max, int defaultValue)
          Create an Integer valued property.
Property(java.lang.String name, java.lang.Object[] allowedValues, java.lang.Object defaultValue)
          Create an enumerated property.
Property(java.lang.String name, RGBColor defaultValue)
          Create an RGBColor valued property.
Property(java.lang.String name, java.lang.String defaultValue)
          Create a String valued property.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Object[] getAllowedValues()
          Get the list of allowed values.
 java.lang.Object getDefaultValue()
          Get the default value for this property.
 double getMaximum()
          Get the maximum allowed value.
 double getMinimum()
          Get the minimum allowed value.
 java.lang.String getName()
          Get the name of this property.
 Property.PropertyType getType()
          Get the type of this property.
 int hashCode()
           
 boolean isLegalValue(java.lang.Object value)
          Determine whether an object represents a legal value for this property.
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOUBLE

public static final Property.PropertyType DOUBLE
A property whose values are represented by Double objects.


INTEGER

public static final Property.PropertyType INTEGER
A property whose values are represented by Integer objects.


BOOLEAN

public static final Property.PropertyType BOOLEAN
A property whose values are represented by Boolean objects.


STRING

public static final Property.PropertyType STRING
A property whose values are represented by String objects.


COLOR

public static final Property.PropertyType COLOR
A property whose values are represented by RGBColor objects.


ENUMERATION

public static final Property.PropertyType ENUMERATION
A property whose values must be one of a fixed set of allowed values.

Constructor Detail

Property

public Property(java.lang.String name,
                double min,
                double max,
                double defaultValue)
Create a Double valued property.


Property

public Property(java.lang.String name,
                int min,
                int max,
                int defaultValue)
Create an Integer valued property.


Property

public Property(java.lang.String name,
                boolean defaultValue)
Create a Boolean valued property.


Property

public Property(java.lang.String name,
                java.lang.String defaultValue)
Create a String valued property.


Property

public Property(java.lang.String name,
                RGBColor defaultValue)
Create an RGBColor valued property.


Property

public Property(java.lang.String name,
                java.lang.Object[] allowedValues,
                java.lang.Object defaultValue)
Create an enumerated property.

Method Detail

getName

public java.lang.String getName()
Get the name of this property.


getType

public Property.PropertyType getType()
Get the type of this property.


getDefaultValue

public java.lang.Object getDefaultValue()
Get the default value for this property.


getMinimum

public double getMinimum()
Get the minimum allowed value. The return value is undefined and meaningless if this property has a type other than DOUBLE or INTEGER.


getMaximum

public double getMaximum()
Get the maximum allowed value. The return value is undefined and meaningless if this property has a type other than DOUBLE or INTEGER.


getAllowedValues

public java.lang.Object[] getAllowedValues()
Get the list of allowed values. The return value is undefined and meaningless if this property has a type other than ENUMERATION.


isLegalValue

public boolean isLegalValue(java.lang.Object value)
Determine whether an object represents a legal value for this property.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 1999-2011 by Peter Eastman.