byucc.edif
Class NamedPropertyObject

java.lang.Object
  extended by byucc.edif.NamedPropertyObject
All Implemented Interfaces:
Nameable, Properties, java.io.Serializable
Direct Known Subclasses:
EdifCell, EdifCellInstance, EdifDesign, EdifEnvironment, EdifLibrary, EdifNet, EdifPort, EdifSingleBitPort

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

Represents a container class that contains an EdifNameable object (to define the name of this object) as well as a PropertyList object to store all properties of the object. This class is a useful base class for many of the Edif objects used in this package.

To save memory, this class will not create any PropertyList object unless properties are added to the object.

Version:
$Id: NamedPropertyObject.java,v 1.28 2005/12/08 17:41:58 nhr2 Exp $
Author:
Mike Wirthlin, Tyler Anderson
See Also:
Serialized Form

Field Summary
private  EdifNameable _name
          The EdifNameable object that names this object.
private  PropertyList _pl
          The PropertyList object.
 
Constructor Summary
NamedPropertyObject(EdifNameable name)
          Constructs a NamedPropertyObject with the specified name object as its value
NamedPropertyObject(java.lang.String name)
          Constructs a NamedPropertyObject with the specified name
 
Method Summary
 void addProperty(Property p)
          Adds a single property to this object.
 void addProperty(java.lang.String name, NewTypedValue value)
          Adds a single property to this object.
 void copyProperties(Properties props)
          This method is used to copy all the properties associated with the Properties object passed in as an argument into this Properites object.
 boolean equals(NamedPropertyObject cmp)
           
 boolean equalsProperties(NamedPropertyObject cmp)
          Returns True if the passed-in NamedPropertyObject's PropertyList matches the PropertyList Object contained in this Object.
 EdifNameable getEdifNameable()
          Get the EdifNameable object that names this object.
 java.lang.String getName()
          Get the Edif name of this object.
 java.lang.String getOldName()
          Return the "old name" associated with this Named object.
 Property getProperty(java.lang.String str)
          Get a property from this object.
 PropertyList getPropertyList()
          Return the complete PropertyList of this object.
(package private)  void rename(java.lang.String newName)
          Renames this object.
(package private)  void rename(java.lang.String newName, java.lang.String oldName)
          Renames this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_pl

private PropertyList _pl
The PropertyList object. This is kept null unless at least one property is added to the object.


_name

private EdifNameable _name
The EdifNameable object that names this object.

Constructor Detail

NamedPropertyObject

public NamedPropertyObject(java.lang.String name)
Constructs a NamedPropertyObject with the specified name

Parameters:
name - The name of this new NamedPropertyObject

NamedPropertyObject

public NamedPropertyObject(EdifNameable name)
Constructs a NamedPropertyObject with the specified name object as its value

Parameters:
name - The object containing name information for this new NamedPropertyObject
Method Detail

rename

void rename(java.lang.String newName,
            java.lang.String oldName)
Renames this object.

Parameters:
newName - The new name for this object
oldName - The new name for this object

rename

void rename(java.lang.String newName)
Renames this object.

Parameters:
newName - The new name for this object

addProperty

public void addProperty(java.lang.String name,
                        NewTypedValue value)
Adds a single property to this object.

Parameters:
name - The name of the property object
value - The instance specific value of this property

addProperty

public void addProperty(Property p)
Adds a single property to this object.

Specified by:
addProperty in interface Properties
Parameters:
p - The Property Object to add to this objects list of properties.

copyProperties

public void copyProperties(Properties props)
Description copied from interface: Properties
This method is used to copy all the properties associated with the Properties object passed in as an argument into this Properites object.

Specified by:
copyProperties in interface Properties

equals

public boolean equals(NamedPropertyObject cmp)

equalsProperties

public boolean equalsProperties(NamedPropertyObject cmp)
Returns True if the passed-in NamedPropertyObject's PropertyList matches the PropertyList Object contained in this Object.

Parameters:
cmp - The Object whose PropertyList Object will be matched up with the one in this Object
Returns:
True if this Object's PropertyList matches with the passed-in one's PropertyList

getName

public java.lang.String getName()
Get the Edif name of this object.

Specified by:
getName in interface Nameable
Returns:
A String Object specifying the name of this object

getOldName

public java.lang.String getOldName()
Return the "old name" associated with this Named object. If the object does not have an old name (i.e. it is not of type RenamedObject), it will return the Edif name.

Returns:
EDIF old name

getEdifNameable

public EdifNameable getEdifNameable()
Get the EdifNameable object that names this object.

Returns:
An EdifNameable Object that contains the name information of this object

getProperty

public Property getProperty(java.lang.String str)
Get a property from this object.

Specified by:
getProperty in interface Properties
Parameters:
str - The 'key' of the property
Returns:
A Property Object that corresponds to the passed-in String object

getPropertyList

public PropertyList getPropertyList()
Return the complete PropertyList of this object.

Specified by:
getPropertyList in interface Properties
Returns:
A PropertyList Object containing all the properties of this object