mro.util.properties
Class Property

java.lang.Object
  extended by mro.util.properties.Property
Direct Known Subclasses:
PropertyAverage, PropertyGroup

public class Property
extends java.lang.Object

A property of some kind with description. Used in many objects to make presentation of results easier. Handles String, boolean, int, double fairly well... Not for anything else, yet.


Field Summary
(package private)  int kind
           
(package private)  java.lang.String name
           
(package private)  java.lang.String propertyDescription
           
(package private)  java.lang.Object value
           
(package private)  java.util.Vector valueDescriptions
           
 
Constructor Summary
  Property()
           
  Property(Property p2)
          Copy Constructor.
  Property(java.lang.String name, boolean value, java.lang.String propertyDescription)
           
  Property(java.lang.String name, double value, java.lang.String propertyDescription)
           
  Property(java.lang.String name, int value, java.lang.String propertyDescription)
           
private Property(java.lang.String name, java.lang.Object value, java.lang.String propertyDescription)
           
  Property(java.lang.String name, java.lang.String value, boolean string, java.lang.String propertyDescription)
          To read from XML files...
  Property(java.lang.String name, java.lang.String value, java.lang.String propertyDescription)
           
 
Method Summary
 void addValueDescription(PropertyValueDescription cpvd)
           
 void addVectorOfValueDescriptions(java.util.Vector vvd)
           
 boolean equals(Property p)
          Checks for similarity on all instance variable, except "valueDescriptions".
 java.util.Vector getAllValueDescriptions()
           
 java.lang.String getAppropriateValueDescription()
           
 java.lang.String getDescription()
           
 int getKind()
          Returns an int telling what kind of value.
 java.lang.String getName()
           
 java.lang.Object getValue()
           
 void printXML(java.io.PrintWriter pw)
           
 void setValue(java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

java.lang.String name

value

java.lang.Object value

kind

int kind

propertyDescription

java.lang.String propertyDescription

valueDescriptions

java.util.Vector valueDescriptions
Constructor Detail

Property

public Property()

Property

private Property(java.lang.String name,
                 java.lang.Object value,
                 java.lang.String propertyDescription)

Property

public Property(java.lang.String name,
                java.lang.String value,
                java.lang.String propertyDescription)

Property

public Property(java.lang.String name,
                int value,
                java.lang.String propertyDescription)

Property

public Property(java.lang.String name,
                double value,
                java.lang.String propertyDescription)

Property

public Property(java.lang.String name,
                boolean value,
                java.lang.String propertyDescription)

Property

public Property(Property p2)
Copy Constructor.


Property

public Property(java.lang.String name,
                java.lang.String value,
                boolean string,
                java.lang.String propertyDescription)
To read from XML files...

Method Detail

setValue

public void setValue(java.lang.Object value)

getValue

public java.lang.Object getValue()

getKind

public int getKind()
Returns an int telling what kind of value. 0 - String, 1 - boolean, 2 - integer, 3 - double.

Returns:
an int

getName

public java.lang.String getName()

getDescription

public java.lang.String getDescription()

addValueDescription

public void addValueDescription(PropertyValueDescription cpvd)

addVectorOfValueDescriptions

public void addVectorOfValueDescriptions(java.util.Vector vvd)

getAppropriateValueDescription

public java.lang.String getAppropriateValueDescription()

getAllValueDescriptions

public java.util.Vector getAllValueDescriptions()

equals

public boolean equals(Property p)
Checks for similarity on all instance variable, except "valueDescriptions".


printXML

public void printXML(java.io.PrintWriter pw)
              throws java.io.IOException
Throws:
java.io.IOException