nz.ac.waikato.mcennis.rat.graph.property
Class BasicProperty

java.lang.Object
  extended by nz.ac.waikato.mcennis.rat.graph.model.ModelShell
      extended by nz.ac.waikato.mcennis.rat.graph.property.BasicProperty
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, Model, Property

public class BasicProperty
extends ModelShell
implements Property

Class describing properties on graphs and actors

See Also:
Serialized Form

Field Summary
 
Fields inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell
listener
 
Fields inherited from interface nz.ac.waikato.mcennis.rat.graph.property.Property
ADD_VALUE
 
Constructor Summary
BasicProperty(java.lang.String name, java.lang.Class type)
          Creates a new instance of BasicProperty
 
Method Summary
 void add(java.lang.Object value)
          Add a new value to this property
 int compareTo(java.lang.Object o)
           
 Property duplicate()
          create a deep copy of this property
 boolean equals(java.lang.Object obj)
           
 java.lang.Class getPropertyClass()
          Return the type of class that this property represents.
 java.lang.String getType()
          return this property's unique id
 java.lang.Object[] getValue()
          return array of all values.
 
Methods inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell
addListener, fireChange
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.model.Model
addListener
 

Constructor Detail

BasicProperty

public BasicProperty(java.lang.String name,
                     java.lang.Class type)
Creates a new instance of BasicProperty

Parameters:
name - id for this property
Method Detail

getValue

public java.lang.Object[] getValue()
Description copied from interface: Property
return array of all values. Returns an empty array if no properties are present

Specified by:
getValue in interface Property
Returns:
array of property values

getType

public java.lang.String getType()
Description copied from interface: Property
return this property's unique id

Specified by:
getType in interface Property
Returns:
id of this object

add

public void add(java.lang.Object value)
Description copied from interface: Property
Add a new value to this property

Specified by:
add in interface Property
Parameters:
value - new object to be added

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
Specified by:
compareTo in interface java.lang.Comparable
Throws:
java.lang.ClassCastException

equals

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

duplicate

public Property duplicate()
Description copied from interface: Property
create a deep copy of this property

Specified by:
duplicate in interface Property
Returns:
deep copy of this property

getPropertyClass

public java.lang.Class getPropertyClass()
Description copied from interface: Property
Return the type of class that this property represents. All objects in one property must be of the same type.

Specified by:
getPropertyClass in interface Property
Returns:
name of class types of objects