|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.byu.phun.PropertyContainer
public class PropertyContainer
This is the super class for objects that have properties. This class uses reflection to obtain a list of properties supported by various subclasses of this class. A property is defined by a pair of methods "getPropertyName()" and "setPropertyName()". The set method is optional. Properties can only be double, color, point or string. Property names are case sensitive.
Constructor Summary | |
---|---|
PropertyContainer()
|
Method Summary | |
---|---|
Color |
getPropertyC(java.lang.String name)
This will get the value of a color property. |
double |
getPropertyD(java.lang.String name)
This will get the value of a double property. |
Point3d |
getPropertyP(java.lang.String name)
This will get the value of a point property. |
java.lang.String |
getPropertyS(java.lang.String name)
This will get the value of a String property. |
boolean |
propertyIsColor(java.lang.String name)
Tests to see if a given property is a color. |
boolean |
propertyIsDouble(java.lang.String name)
Tests to see if a given property is a double. |
boolean |
propertyIsPoint(java.lang.String name)
Tests to see if a given property is a point. |
boolean |
propertyIsSettable(java.lang.String name)
Returns true if the property exists and has a "set" method. |
boolean |
propertyIsString(java.lang.String name)
Tests to see if a given property is a string. |
java.lang.String[] |
propertyNames()
Returns a list of the property names associated with this object. |
void |
setProperty(java.lang.String name,
Color color)
This will set the value of a Color property. |
void |
setProperty(java.lang.String name,
double d)
This will set the value of a double property. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PropertyContainer()
Method Detail |
---|
public java.lang.String[] propertyNames()
public boolean propertyIsColor(java.lang.String name)
name
- the case sensitive name of the property.
public boolean propertyIsPoint(java.lang.String name)
name
- the case sensitive name of the property.
public boolean propertyIsDouble(java.lang.String name)
name
- the case sensitive name of the property.
public boolean propertyIsString(java.lang.String name)
name
- the case sensitive name of the property.
public Color getPropertyC(java.lang.String name)
name
- the case sensitive name of the property.
public double getPropertyD(java.lang.String name)
name
- the case sensitive name of the property.
public Point3d getPropertyP(java.lang.String name)
name
- the case sensitive name of the property.
public java.lang.String getPropertyS(java.lang.String name)
name
- the case sensitive name of the property.
public void setProperty(java.lang.String name, Color color)
name
- the case sensitive name of the property.color
- the color to be set into the property.public void setProperty(java.lang.String name, double d)
name
- the case sensitive name of the property.d
- the number to be set into the property.public boolean propertyIsSettable(java.lang.String name)
name
- the case sensitive name of the property.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |