sim.util
Class Properties

java.lang.Object
  extended bysim.util.Properties
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
CollectionProperties, SimpleProperties

public abstract class Properties
extends java.lang.Object
implements java.io.Serializable

Inspects an object and returns a list of variables for which there are get and possibly set methods.

See Also:
Serialized Form

Constructor Summary
Properties()
           
 
Method Summary
 java.lang.String betterToString(java.lang.Object obj)
           
abstract  java.lang.String getName(int index)
           
static Properties getProperties(java.lang.Object object, boolean expandCollections, boolean includeSuperclasses, boolean includeGetClass)
          If expandCollections is true, then if object is a Map, Indexed, or Collection, then it will be treated using CollectionProperties.
abstract  java.lang.Class getType(int index)
           
protected  java.lang.Class getTypeConversion(java.lang.Class type)
           
abstract  java.lang.Object getValue(int index)
           
 boolean isComposite(int index)
           
abstract  boolean isReadWrite(int index)
           
abstract  boolean isVolatile()
          Returns true if the number or order of properties could change at any time
abstract  int numProperties()
           
 java.lang.Object setValue(int index, java.lang.Object value)
          Sets the current value of the property.
 java.lang.Object setValue(int index, java.lang.String value)
          Sets the current value of the property to the value parsed from the given string.
protected  java.lang.String typeToName(java.lang.Class type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Properties

public Properties()
Method Detail

getProperties

public static Properties getProperties(java.lang.Object object,
                                       boolean expandCollections,
                                       boolean includeSuperclasses,
                                       boolean includeGetClass)
If expandCollections is true, then if object is a Map, Indexed, or Collection, then it will be treated using CollectionProperties. Otherwise it will be treated using SimpleProperties. Arrays are always treated using CollectionProperties. If includeGetClass is true, then the Class property will be included. If includeSuperclasses is true, then any SimpleProperties will include superclasses.


isVolatile

public abstract boolean isVolatile()
Returns true if the number or order of properties could change at any time


numProperties

public abstract int numProperties()

getValue

public abstract java.lang.Object getValue(int index)

isReadWrite

public abstract boolean isReadWrite(int index)

isComposite

public boolean isComposite(int index)

getName

public abstract java.lang.String getName(int index)

getType

public abstract java.lang.Class getType(int index)

setValue

public java.lang.Object setValue(int index,
                                 java.lang.Object value)
Sets the current value of the property. Simple values (byte, int, etc.) must be boxed (into Byte, Integer, etc.). Then returns the current (hopefully changed) value of the property. Returns null if an error occurs or if the index is out of the range [0 ... numProperties() - 1 ]


setValue

public java.lang.Object setValue(int index,
                                 java.lang.String value)
Sets the current value of the property to the value parsed from the given string. Then returns the current (hopefully changed) value of the property. Returns null if an error occurs or if the index is out of the range [0 ... numProperties() - 1 ]


getTypeConversion

protected java.lang.Class getTypeConversion(java.lang.Class type)

betterToString

public java.lang.String betterToString(java.lang.Object obj)

typeToName

protected java.lang.String typeToName(java.lang.Class type)