byucc.edif
Class EdifCellInstance

java.lang.Object
  extended bybyucc.edif.NamedPropertyObject
      extended bybyucc.edif.EdifCellInstance
All Implemented Interfaces:
EdifOut, Nameable, Properties, java.io.Serializable

public class EdifCellInstance
extends NamedPropertyObject
implements EdifOut, java.io.Serializable

Represents a specific instance of an EdifCell object. This object contains a reference to the EdifCell that is instanced and a reference to the parent EdifCell object that instanced this cell.

To Do:

Version:
$Id: EdifCellInstance.java,v 1.48 2004/08/27 19:16:42 tsa6 Exp $
Author:
Welson Sun, Mike Wirthlin, Tyler Anderson
See Also:
Serialized Form

Field Summary
private  EdifCell _cellType
          This EdifCell reference refers to the type of EdifCell that is instanced.
private  EdifCell _parent
          This EdifCell reference refers to the the parent EdifCell object that instanced the cell.
 
Fields inherited from class byucc.edif.NamedPropertyObject
 
Constructor Summary
EdifCellInstance(EdifNameable name)
          Constructs an Empty, named EdifCellInstance Object.
EdifCellInstance(EdifNameable name, EdifCell parent)
          Constucts a typeless, named EdifCellInstace Object with the specified parent.
EdifCellInstance(EdifNameable name, EdifCell parent, EdifCell type)
          Constructs a typed, named EdifCellInstace Object with the specified parent.
EdifCellInstance(java.lang.String name)
          Constructs an Empty, named EdifCellInstance Object.
EdifCellInstance(java.lang.String name, EdifCell parent)
          Constucts a typeless, named EdifCellInstace Object with the specified parent.
EdifCellInstance(java.lang.String name, EdifCell parent, EdifCell type)
          Constructs a typed, named EdifCellInstace Object with the specified parent.
 
Method Summary
 EdifCellInstance copy()
           
 EdifCellInstance copy(EdifCell parent)
          Returns a deep copy of this EdifCellInstance using the passed-in EdifCell as the parent.
 EdifCell getCellRef()
          Deprecated. Please use EdifCellInstance.getCellType()
 EdifCell getCellType()
          Returns the cell that this EdifCellInstance object is referring to.
 java.util.Map getEdifCellInstanceNetPortRefs()
          This method will determine the parent cell of an EdifCellInstance and search through the nets of this parent cell.
 java.util.Collection getEdifCellInstanceNets()
          This method will determine the parent cell of an EdifCellInstance and search through the nets of this parent cell.
 java.util.Collection getHierarchicalPrimitiveList()
          Returns a Collection of List objects for each primitive instance within the hierarchy of this cell instance.
 EdifCell getParent()
          Returns the parent cell that is referring to the cell that this EdifCellInstance object is referring to.
 EdifPortRef getPortRef(EdifPort port)
          Returns the port ref that refers to the passed-in EdifPort.
 java.lang.String getType()
          Returns the type of this cell as a String.
 boolean matchesWithin(java.util.Collection instanceList)
          Returns true if the current instance matches within the passed-in collection of EdifCellInstance Objects.
 boolean matchesWithin(java.util.Map instanceList)
          Returns true if the current instance matches within the passed-in Map of EdifCellInstance Objects.
 void modifyCellRef(EdifCell newCellRef)
          Modify the internal cell reference used by this EdifCellInstance.
(package private)  void modifyCellRef(EdifCell newCellRef, boolean check)
          Modify the internal cell reference used by this EdifCellInstance.
(package private)  void setParent(EdifCell p)
          Sets the parent cell that is referring to the cell this EdifCellInstance object is referring to.
 void toEdif(EdifPrintWriter epw)
          Writes the EDIF representation of this EdifCellInstance object to the EdifPrintWriter passed as a parameter.
 java.lang.String toString()
          Returns a String representation of the EdifCellInstance object.
 
Methods inherited from class byucc.edif.NamedPropertyObject
addProperty, addProperty, equals, equalsProperties, getEdifNameable, getName, getProperty, getPropertyList, rename, rename
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_cellType

private EdifCell _cellType
This EdifCell reference refers to the type of EdifCell that is instanced.


_parent

private EdifCell _parent
This EdifCell reference refers to the the parent EdifCell object that instanced the cell.

Constructor Detail

EdifCellInstance

public EdifCellInstance(java.lang.String name)
Constructs an Empty, named EdifCellInstance Object.

Parameters:
name - The name of this EdifCellInstance Object

EdifCellInstance

public EdifCellInstance(EdifNameable name)
Constructs an Empty, named EdifCellInstance Object.

Parameters:
name - The Object that holds name information for this EdifCellInstance Object

EdifCellInstance

public EdifCellInstance(java.lang.String name,
                        EdifCell parent)
Constucts a typeless, named EdifCellInstace Object with the specified parent.

Parameters:
name - The name of this EdifCellInstance Object
parent - The EdifCell Object that contains this EdifCellInstace

EdifCellInstance

public EdifCellInstance(EdifNameable name,
                        EdifCell parent)
Constucts a typeless, named EdifCellInstace Object with the specified parent.

Parameters:
name - The Object that holds name information for this EdifCellInstance Object
parent - The EdifCell Object that contains this EdifCellInstace

EdifCellInstance

public EdifCellInstance(java.lang.String name,
                        EdifCell parent,
                        EdifCell type)
Constructs a typed, named EdifCellInstace Object with the specified parent.

Parameters:
name - The name of this EdifCellInstance Object
parent - The EdifCell Object that contains this EdifCellInstace
type - The type of this EdifCellInstance Object, or the EdifCell Object that this EdifCellInstance is instancing

EdifCellInstance

public EdifCellInstance(EdifNameable name,
                        EdifCell parent,
                        EdifCell type)
Constructs a typed, named EdifCellInstace Object with the specified parent.

Parameters:
name - The Object that holds name information for this EdifCellInstance Object
parent - The EdifCell Object that contains this EdifCellInstace
type - The type of this EdifCellInstance Object, or the EdifCell Object that this EdifCellInstance is instancing
Method Detail

copy

public EdifCellInstance copy(EdifCell parent)
Returns a deep copy of this EdifCellInstance using the passed-in EdifCell as the parent. All new Objects are created using the 'new' statement, except Strings.

Parameters:
parent - The EdifCell that will contain the new EdifCellInstance
Returns:
A new EdifCellInstance Object

copy

public EdifCellInstance copy()

getEdifCellInstanceNets

public java.util.Collection getEdifCellInstanceNets()
This method will determine the parent cell of an EdifCellInstance and search through the nets of this parent cell. Those nets that connect to the given EdifCellInstance are returned as a List.

Returns:
A Collection of EdifNet Objects that connect to this EdifCellInstance Object

getEdifCellInstanceNetPortRefs

public java.util.Map getEdifCellInstanceNetPortRefs()
This method will determine the parent cell of an EdifCellInstance and search through the nets of this parent cell. Those nets that connect to the given EdifCellInstance are returned as a Map. The value is the EdifPortRef and the Value is the EdifNet.

Returns:
A Map object that contains a mapping between EdifPortRef Objects of this EdifCellInstance Object and EdifNet Objects that connect to EdifPortRefs of this EdifCellInstance Object

getCellRef

public EdifCell getCellRef()
Deprecated. Please use EdifCellInstance.getCellType()


getCellType

public EdifCell getCellType()
Returns the cell that this EdifCellInstance object is referring to.

Returns:
An EdifCell Object Referring to the type of this EdifCellInstance, or the EdifCell that this EdifCellInstance is instancing

getHierarchicalPrimitiveList

public java.util.Collection getHierarchicalPrimitiveList()
Returns a Collection of List objects for each primitive instance within the hierarchy of this cell instance.

Returns:
A Collection of hierarchical primitives

getParent

public EdifCell getParent()
Returns the parent cell that is referring to the cell that this EdifCellInstance object is referring to.

Returns:
The EdifCell Object that contains this EdifCellInstance

getPortRef

public EdifPortRef getPortRef(EdifPort port)
Returns the port ref that refers to the passed-in EdifPort.

Parameters:
port - The EdifPort Object that will be searched for within this EdifCellInstance
Returns:
The corresponding EdifPortRef

getType

public java.lang.String getType()
Returns the type of this cell as a String.

Returns:
A String representing what type of cell this is.

matchesWithin

public boolean matchesWithin(java.util.Map instanceList)
Returns true if the current instance matches within the passed-in Map of EdifCellInstance Objects. Equality done by doing a deep compare on the cell types of each instance, and the name of each instance.

Parameters:
instanceList - This EdifCellInstance Object will be compared against all the elements in this passed-in Map to see if a match exists within the Map

matchesWithin

public boolean matchesWithin(java.util.Collection instanceList)
Returns true if the current instance matches within the passed-in collection of EdifCellInstance Objects. Equality done by doing a deep compare on the cell types of each instance, and the name of each instance.

Parameters:
instanceList - This EdifCellInstance Object will be compared against all the elements in this passed-in Collection to see if a match exists within the Collection

modifyCellRef

public void modifyCellRef(EdifCell newCellRef)
Modify the internal cell reference used by this EdifCellInstance.

Parameters:
newCellRef - An EdifCell Object--The cell this EdifCellInstance object will now refer to

modifyCellRef

void modifyCellRef(EdifCell newCellRef,
                   boolean check)
Modify the internal cell reference used by this EdifCellInstance.

Parameters:
newCellRef - An EdifCell Object--The cell this EdifCellInstance object will now refer to
check - If true, will check to see if the interfaces are equal, and if it's ok to make the switch. For speed, and if it's known that the match will succeed, use false

setParent

void setParent(EdifCell p)
Sets the parent cell that is referring to the cell this EdifCellInstance object is referring to.

Parameters:
p - An EdifCell Object--The parent referring to the cell of this EdifCellInstance.

toEdif

public void toEdif(EdifPrintWriter epw)
Writes the EDIF representation of this EdifCellInstance object to the EdifPrintWriter passed as a parameter.

Specified by:
toEdif in interface EdifOut
Parameters:
epw - EdifPrintWriter to which EDIF will be written

toString

public java.lang.String toString()
Returns a String representation of the EdifCellInstance object. This simply corresponds to the name of the EdifCellInstance and its type.

Returns:
String description of the EdifCell object