edu.byu.ece.edif.core
Class PropertyList

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<java.lang.String,Property>
              extended by edu.byu.ece.edif.core.PropertyList
All Implemented Interfaces:
EdifOut, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,Property>

public class PropertyList
extends java.util.LinkedHashMap<java.lang.String,Property>
implements EdifOut

Provides a LinkedHashMap of Property objects. The key of this Map is a lower-case String object (EDIF is case insensitive) and the value is a Property object. The key for all objects in this Map is property.getName().toLowerCase().

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

Constructor Summary
PropertyList()
          Construct a PropertyList Object with an initial capacity of 1 and a load factor 0.95.
 
Method Summary
 void addProperty(Property p)
          Add a Property to the PropertyList; the key is the Property's name.
 void addPropertyList(PropertyList list)
          Add a list of properties to the PropertyList
 java.lang.Object clone()
          Return an Object that is a clone of this one.
 boolean equals(PropertyList cmp)
          Return true if this PropertyList equals or matches the passed-in one.
 Property getProperty(java.lang.String str)
          Get the Property according to the Property's name
 void toEdif(EdifPrintWriter epw)
          Generate the EDIF text for this list of properties.
 java.lang.String toString()
          Return a String representation of this Object.
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
 
Methods inherited from class java.util.HashMap
containsKey, entrySet, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

PropertyList

public PropertyList()
Construct a PropertyList Object with an initial capacity of 1 and a load factor 0.95.

Method Detail

addProperty

public void addProperty(Property p)
Add a Property to the PropertyList; the key is the Property's name.

Parameters:
p - a Property value representing the property to add to this PropertyList Object

addPropertyList

public void addPropertyList(PropertyList list)
Add a list of properties to the PropertyList

Parameters:
list - The PropertyList object that contains the list of properties to add to this list.

clone

public java.lang.Object clone()
Return an Object that is a clone of this one.

Overrides:
clone in class java.util.HashMap<java.lang.String,Property>
Returns:
an Object that is a clone of this PropertyList Object

equals

public boolean equals(PropertyList cmp)
Return true if this PropertyList equals or matches the passed-in one.

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

getProperty

public Property getProperty(java.lang.String str)
Get the Property according to the Property's name

Parameters:
str - a String value specifying the desired property. This String will be converted to lower case as the key in this Map are Strings in lower case.
Returns:
a Property value representing the property

toEdif

public void toEdif(EdifPrintWriter epw)
Generate the EDIF text for this list of properties.

Specified by:
toEdif in interface EdifOut
Parameters:
epw - The EdifPrintWriter object used for writing the Edif.

toString

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

Overrides:
toString in class java.util.AbstractMap<java.lang.String,Property>
Returns:
A String Object representing this PropertyList Object