edu.byu.ece.edif.core
Class Property

java.lang.Object
  extended by edu.byu.ece.edif.core.Property
All Implemented Interfaces:
EdifOut, Nameable, java.io.Serializable

public class Property
extends java.lang.Object
implements Nameable, EdifOut, java.io.Serializable

Specifies a String name/value pair to describe an EDIF property. The Property name defines the name of a given property and the value defines the actual value assigned to the property.

Version:
$Id:Property.java 198 2008-04-16 21:14:21Z jamesfcarroll $
See Also:
Serialized Form

Field Summary
private  EdifNameable _name
          The actual name of the property
private  EdifTypedValue _value
          The actual String value of the property
 
Constructor Summary
Property(EdifNameable name, EdifTypedValue setValue)
           
Property(java.lang.String setName, boolean bool)
          Construct a Property Object with the specified name and value as a BooleanTypedValue.
Property(java.lang.String setName, EdifTypedValue setValue)
          Construct a Property Object with the specified name and value as a EdifTypedValue.
Property(java.lang.String setName, int i)
          Construct a Property Object with the specified name and value as an IntegerTypedValue.
Property(java.lang.String setName, java.lang.String str)
          Construct a Property Object with the specified name and value as a StringTypedValue.
 
Method Summary
 java.lang.Object clone()
          Clone this Property Object and return a clone of it.
 boolean equals(Property p)
          Return True if this Property matches the passed-in one, making sure they are the same type, value, etc.
 boolean existsWithin(java.util.Map<java.lang.String,Property> properties)
          Return True if this Property Object matches with one of the Objects in the passed-in Map Object.
 java.lang.String getName()
          Return the name of this Object.
 EdifTypedValue getValue()
          Return the typed value of this object.
 void setValue(EdifTypedValue val)
          Set the typed value of this object.
 void toEdif(EdifPrintWriter epw)
          Convert this Property Object to EDIF format and write it to the passed-in EdifPrintWriter Object.
 java.lang.String toString()
          Return a String representation of this object.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_name

private EdifNameable _name
The actual name of the property


_value

private EdifTypedValue _value
The actual String value of the property

Constructor Detail

Property

public Property(EdifNameable name,
                EdifTypedValue setValue)

Property

public Property(java.lang.String setName,
                EdifTypedValue setValue)
Construct a Property Object with the specified name and value as a EdifTypedValue.

Parameters:
setName - The name of this new Property Object
setValue - The value of this new Property Object

Property

public Property(java.lang.String setName,
                java.lang.String str)
Construct a Property Object with the specified name and value as a StringTypedValue.

Parameters:
setName - The name of this new Property Object
str - The String value of this new Property Object

Property

public Property(java.lang.String setName,
                boolean bool)
Construct a Property Object with the specified name and value as a BooleanTypedValue.

Parameters:
setName - The name of this new Property Object
bool - The boolean value of this new Property Object

Property

public Property(java.lang.String setName,
                int i)
Construct a Property Object with the specified name and value as an IntegerTypedValue.

Parameters:
setName - The name of this new Property Object
i - The integer value of this new Property Object
Method Detail

clone

public java.lang.Object clone()
Clone this Property Object and return a clone of it.

Overrides:
clone in class java.lang.Object
Returns:
An Object that is a clone of this Property Object

equals

public boolean equals(Property p)
Return True if this Property matches the passed-in one, making sure they are the same type, value, etc.

Parameters:
p - The Property Object to compare this one to
Returns:
True if this Property Object matches the passed-in one

existsWithin

public boolean existsWithin(java.util.Map<java.lang.String,Property> properties)
Return True if this Property Object matches with one of the Objects in the passed-in Map Object. The Property's name is used as key.

Parameters:
properties - A list of properties to match against with this one
Returns:
True if this Property Object matches with one of the Property Objects contained in the passed-in Map Object

getName

public java.lang.String getName()
Return the name of this Object.

Specified by:
getName in interface Nameable
Returns:
A String Object representing the name of this Property Object.

getValue

public EdifTypedValue getValue()
Return the typed value of this object.

Returns:
A EdifTypedValue Object representing the typed value of this Property Object

setValue

public void setValue(EdifTypedValue val)
Set the typed value of this object.

Parameters:
val - The new typed value of this object

toEdif

public void toEdif(EdifPrintWriter epw)
Convert this Property Object to EDIF format and write it to the passed-in EdifPrintWriter Object.

Specified by:
toEdif in interface EdifOut
Parameters:
epw - The EdifPrintWriter Object that the EDIF will be written to.

toString

public java.lang.String toString()
Return a String representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
A String object representing this Property Object.