byucc.edif
Class EdifLibrary

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

public class EdifLibrary
extends NamedPropertyObject
implements EdifOut, Trimable, java.io.Serializable

Represents a library which is an ordered list of EdifCell objects. The order of EdifCell objects within the library must conform to the EDIF "define before use" policy. In other words, all EdifCellInstance objects contained by a given EdifCell object must be defined in the library before the given EdifCell object has been. One of the main purposes of this class is to make sure that this object ordering is preserved and maintained.

It is not necessary for all cells used by the library are defined in the library. EDIF supports multiple libraries and it is possible that EdifCells used in a given library are actually defined in a "previous" library. The EdifLibraryManager class manages these dependencies between libraries.

To Do:

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

Field Summary
private  ArrayListNameSpaceResolver _edifCells
          The list of cells defined within the library.
private  EdifLibraryManager _edifLibraryManager
          This is a reference to the parent EdifLibraryManager object.
private  boolean _external
          External Keyword The external construct declares a library to which reference is made, but which is not actually present within the current EDIF file.
 
Fields inherited from class byucc.edif.NamedPropertyObject
 
Constructor Summary
EdifLibrary(EdifNameable name)
          Constructs an empty EdifLibrary Object with the specified EdifNameable Object as its name.
EdifLibrary(EdifNameable name, boolean external)
          Constructs an empty EdifLibrary Object with the specified EdifNameable Object as its name, and value for external.
EdifLibrary(java.lang.String name)
          Constructs an empty EdifLibrary Object with the specified name.
EdifLibrary(java.lang.String name, boolean external)
          Constructs an empty EdifLibrary Object with the specified name, and value for external.
 
Method Summary
 boolean addCell(EdifCell cell)
          Add an EdifCell into the ArrayList at the earliest possible position in the library.
 boolean addCell(EdifCell cell, boolean earliest)
          Add an EdifCell into the ArrayList at the earliest or latest position, based on the earliest parameter.
 boolean containsCell(EdifCell cell)
          Returns true if the collection of cells contains the passed-in EdifCell.
 boolean containsCellByName(java.lang.String name)
          Returns true if the collection of cells contains a cell by the passed-in name.
 boolean containsClashingCell(EdifCell cell)
          Indicates whether there is a Cell in the library that clashes with the passed-in cell.
 java.util.Map createCellMap(EdifLibrary lib, boolean checkStructure)
          Creates a Map between EdifCell objects in the passed in library and EdifCell objects in this library.
 boolean deleteCell(EdifCell cell)
          Deletes a cell from the library, and returns whether or not the delete was successful.
 boolean deleteCell(EdifCell cell, boolean force)
          Deletes a cell from the library, and returns whether or not the delete was successful.
 boolean deleteCell(java.lang.String name)
          Deletes a cell from the library, and returns whether or not the delete was successful.
 boolean deleteCell(java.lang.String name, boolean force)
          Deletes a cell from the library, and returns whether or not the delete was successful.
protected  boolean deleteCellAux(EdifCell cell)
          Deletes a cell from the library, and returns whether or not the delete was successful.
 java.util.Collection findBlackBoxes()
          Returns all leafCell, non primitive EdifCell objects within the library.
 java.util.Collection findCellInstancesOf(EdifCell cell)
          This function returns all EdifCellInstances that reference the given in cell in this library.
 java.util.Collection findCellInstancesOf(EdifLibrary lib)
          This function returns all EdifCellInstances that reference cells from the passed-in library.
 java.util.Collection findCellsUsedByInstancesOf(EdifCell cell)
          This function returns a list of EdifCell objects instanced by the given EdifCell object that are contained in the current library.
 java.util.Collection findCellsUsedByInstancesOf(EdifLibrary lib)
          This function returns a list of EdifCell objects instanced by EdifCells of the passed-in EdifLibrary Object that are contained in the current library.
 int findEarliestPositionToAdd(EdifCell cell)
          This method will find the earliest position in the library in which the given EdifCell can be added.
 int findLatestPositionToAdd(EdifCell cell)
          This method will find the latest position in the library in which the given EdifCell can be added.
 EdifCell findMatchingEdifCell(EdifCell cell)
          Overloaded method that defaults to not matching by interface or name only, nor does it check structure.
 EdifCell findMatchingEdifCell(EdifCell cell, boolean equalsNameOnly, boolean equalsStructure, boolean equalsInterfaceOnly)
          Overloaded method that defaults to not matching interface for a possible bus-match.
 EdifCell findMatchingEdifCell(EdifCell cell, boolean equalsNameOnly, boolean equalsStructure, boolean equalsInterfaceOnly, boolean comparePossibleBus)
          Overloaded method that defaults to not matching cell for properties, and port directions are ignored.
 EdifCell findMatchingEdifCell(EdifCell cell, boolean equalsNameOnly, boolean equalsStructure, boolean equalsInterfaceOnly, boolean comparePossibleBus, boolean equalsProperties, boolean ignoreBusDirection)
          Searches the current library for a matching EdifCell.
 java.util.Map findMatchingEdifCells(EdifLibrary lib, boolean equalsStructure)
          Overloaded method defaulting to not comparing EdifCellInterface Objects for a possible bus match.
 java.util.Map findMatchingEdifCells(EdifLibrary lib, boolean equalsStructure, boolean comparePossibleBus)
          This method will attempt to match all EdifCell objects in the passed in library to matching EdifCell objects in this library.
 java.util.Collection findNonReferencedCells()
          This function will return a list of EdifCell objects that are not referenced anywhere within the current Library.
 java.util.Collection findPortRefsOf(EdifCell cell)
          This function will return a list of EdifPortRefs in the entire library that reference the ports of the passed in cell.
 EdifCell getCell(java.lang.String name)
          Return the EdifCell object in this library that is associated with the given String name.
 java.util.Collection getCells()
          Returns the EdifCell Objects in this library.
 EdifLibraryManager getLibraryManager()
          Returns this library's library manager.
 NameSpaceResolver getNameSpaceResolver()
           
 java.util.Collection getNextCells(EdifCell cell)
          Return the collection of cells that are defined after the specified cell in the libarary.
 java.util.Collection getPreviousCells(EdifCell cell)
          Return the collection of cells that are defined before the specified cell in the libarary.
 boolean isExternal()
          Indicates whether this library was tagged with the external tag.
 boolean isPrimitiveLibrary()
          This method will examine each of the EdifCell objects in the library and determine if every EdifCell in the library is a primitive (see EdifCell.isLeafCell()).
 boolean isValid()
          Verify that the Manager is valid (The ordering of the cells are OK).
 java.util.Iterator iterator()
          Return a Collection of EdifCell objects contained by this library.
(package private)  void modifyBusToSinglePorts(EdifPort oldPort, java.util.Collection newPorts)
          Modifies any references from oldPort to the correct EdifPort in newPorts.
(package private)  void modifySinglePortsToBus(java.util.Collection oldPorts, EdifPort newPort)
          Modifies any references from oldPorts to newPort.
 boolean nameClash(EdifCell cell)
          Returns whether or not the given string name will clash with another EdifCell's name.
 void setLibraryManager(EdifLibraryManager libMan)
          Sets this library's library manager to libMan.
 void tagLeafCellsAsPrimitives()
          Tags all leaf cells as primitive.
 void tagPrimitives(EdifLibrary primitives)
          Tags primitives in this library based on whether or not they match cells in the passed in library.
 void toEdif(EdifPrintWriter epw)
          Converts this object to EDIF format and writes it to the passed-in EdifPrintWriter Object.
 java.lang.String toString()
          Returns a String representation of this Object.
 void trimToSize()
          Trims this EdifLibrary Object and and contained Trimmable Objects down to size.
 void validateOrder()
          Re-orders the cells into a proper order (if they aren't already).
 
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

_edifCells

private ArrayListNameSpaceResolver _edifCells
The list of cells defined within the library. The key of this map is the name of the EdifCell (as obtained from the getName() method) and the value is the actual EdifCell object.


_external

private boolean _external
External Keyword

The external construct declares a library to which reference is made, but which is not actually present within the current EDIF file. This may include any library which has been exchanged by means outside the current EDIF file.

The structure and semantics of external are parallel to those of library except that external is known to be incomplete; external libraries that are declared should only contain minimal information. Any information present, such as status, must agree with the information available in the read's library of the same name. External represents one way in which reference can be made to external information from within an EDIF file.

External should occur within a file only with prior consent of the intended receiving party, since it must be assumed that the missing library has already been transimitted. This statement provides an explicit means of declaring libraries, providing a simple check for data completeness. It also provides a mechanism for renaming an external library, since the rename construct may be used here. Cells in external may not have contents sections. Any object referenced later should be defined here, including all names and interface declarations.

     edif ::=
     '(''edif' edifFileNameDef
     edifVersion
     edifLevel
     keywordMap
     {  | external | library | design |
     comment | userdata }
     ')'
     external ::=
     '(''external' libraryNameDef
     edifLevel
     technology
     {< status > | cell | comment | userData }
     ')'a
     
So, this means that external is parallel to library, all the cells in the external definition have only name and ports, the exact definition of these cells should be in other EDIF file, which has a library defined with the same name of this external name, or the accepting system has already had a library with the same name of this external name.


_edifLibraryManager

private EdifLibraryManager _edifLibraryManager
This is a reference to the parent EdifLibraryManager object. This manager manages other related libraries in the library structure.

Constructor Detail

EdifLibrary

public EdifLibrary(java.lang.String name)
Constructs an empty EdifLibrary Object with the specified name.

Parameters:
name - The name of the new EdifLibrary Object

EdifLibrary

public EdifLibrary(EdifNameable name)
Constructs an empty EdifLibrary Object with the specified EdifNameable Object as its name.

Parameters:
name - The name-holding information Object of the new EdifLibrary Object

EdifLibrary

public EdifLibrary(java.lang.String name,
                   boolean external)
Constructs an empty EdifLibrary Object with the specified name, and value for external.

Parameters:
name - The name of the new EdifLibrary Object
external - True if this is an External library

EdifLibrary

public EdifLibrary(EdifNameable name,
                   boolean external)
Constructs an empty EdifLibrary Object with the specified EdifNameable Object as its name, and value for external.

Parameters:
name - The name-holding information Object of the new EdifLibrary Object
external - True if this is an External library
Method Detail

addCell

public boolean addCell(EdifCell cell)
Add an EdifCell into the ArrayList at the earliest possible position in the library.

Parameters:
cell - The EdifCell to add to this EdifLibrary
Returns:
True if the cell was actually added to the library
See Also:
addCell(EdifCell,boolean)

addCell

public boolean addCell(EdifCell cell,
                       boolean earliest)
Add an EdifCell into the ArrayList at the earliest or latest position, based on the earliest parameter. This method makes sure that a cell with a duplicate name is not added to the library.

Parameters:
cell - The EdifCell to add to this EdifLibrary
earliest - If true then place the given cell at the earliest location in the library. If false, place at the latest location in the library
Returns:
True if the cell was actually added to the library
See Also:
EdifLibraryManager.addCell(EdifCell,boolean,boolean,boolean)

createCellMap

public java.util.Map createCellMap(EdifLibrary lib,
                                   boolean checkStructure)
Creates a Map between EdifCell objects in the passed in library and EdifCell objects in this library. The key of the Map is an EdifCell object in the passed in library and the value is an EdifCell object in this library.

Parameters:
lib - The EdifLibrary Object that the mapping will be made with
checkStructure - If true, then cells will be compared for structure as well
Returns:
A Map Object that contains a mapping between cells that match in this library to cells that match in the passed-in library

containsCell

public boolean containsCell(EdifCell cell)
Returns true if the collection of cells contains the passed-in EdifCell.

Parameters:
cell - The cell to check whether or not it exists in this EdifLibrary
Returns:
True if the passed-in EdifCell Object is contained within this EdifLibrary

containsCellByName

public boolean containsCellByName(java.lang.String name)
Returns true if the collection of cells contains a cell by the passed-in name.

Parameters:
name - The name of the cell to see if it exists by name within this EdifLibrary
Returns:
True if this EdifLibrary contains a cell by the name of the passed-in String

containsClashingCell

public boolean containsClashingCell(EdifCell cell)
Indicates whether there is a Cell in the library that clashes with the passed-in cell. A clash occurs when there is a cell in the library with the same name and the cell interfaces of the two cells is different.

Parameters:
cell - The cell to match up with among the cells in this library to see if a clashing cell exists
Returns:
True if this EdifLibrary contains an EdifCell that clashes with the passed-in EdifCell

deleteCell

public boolean deleteCell(EdifCell cell)
Deletes a cell from the library, and returns whether or not the delete was successful. It will, by default, not delete the cell if it's still referenced in the library.

Parameters:
cell - The cell to be deleted.
Returns:
True if the cell was deleted.
See Also:
deleteCell(EdifCell,boolean)

deleteCell

public boolean deleteCell(EdifCell cell,
                          boolean force)
Deletes a cell from the library, and returns whether or not the delete was successful.

Parameters:
cell - The cell to be deleted.
force - Forces the cell to be deleted even if it's still referenced within the library.
Returns:
True if the cell was deleted.
See Also:
EdifLibraryManager.deleteCell(EdifCell,boolean)

deleteCellAux

protected boolean deleteCellAux(EdifCell cell)
Deletes a cell from the library, and returns whether or not the delete was successful.

Parameters:
cell - The cell to be deleted.
Returns:
true if the cell was deleted. false if the cell is not in the library or cell is null
See Also:
deleteCell(EdifCell,boolean)

deleteCell

public boolean deleteCell(java.lang.String name,
                          boolean force)
Deletes a cell from the library, and returns whether or not the delete was successful.

Parameters:
name - Name of the cell to be deleted.
force - Forces the cell to be deleted even if it's still referenced within the library.
Returns:
True if the cell was deleted.
See Also:
deleteCell(EdifCell,boolean)

deleteCell

public boolean deleteCell(java.lang.String name)
Deletes a cell from the library, and returns whether or not the delete was successful. By default, the cell will not be removed if it's still referenced within the library.

Parameters:
name - Name of the cell to be deleted.
Returns:
True if the cell was deleted.
See Also:
deleteCell(EdifCell,boolean)

findEarliestPositionToAdd

public int findEarliestPositionToAdd(EdifCell cell)
This method will find the earliest position in the library in which the given EdifCell can be added. This method check all cells in the library and find those in the library that are referenced by given EdifCell object. This method will return a library postion that insures that the EdifCellInstance objects referenced in this given EdifCell are already defined.

Note that this method will ignore EdifCellInstances of the given EdifCell that are not defined in this library.

Parameters:
cell - The cell to add.
Returns:
The earliest integer postion in which this cell can be added into the ArrayList of Cells.
See Also:
EdifLibraryManager.findEarliestLibraryToAdd(byucc.edif.EdifCell, boolean)

findLatestPositionToAdd

public int findLatestPositionToAdd(EdifCell cell)
This method will find the latest position in the library in which the given EdifCell can be added. This method check all cells in the library and find those EdifCells in the library that instance this given EdifCell object. This method will return a library postion that insures that the given EdifCell object is defined before other library elements use it.

Parameters:
cell - The cell to add.
Returns:
The latest integer postion in which this cell can be added into the ArrayList of Cells.
See Also:
EdifLibraryManager.findLatestLibraryToAdd(byucc.edif.EdifCell, boolean)

findPortRefsOf

public java.util.Collection findPortRefsOf(EdifCell cell)
This function will return a list of EdifPortRefs in the entire library that reference the ports of the passed in cell. This method will return null if no EdifPortRefs are found.

Parameters:
cell - The cell who has the ports to check the port references for.
Returns:
A Collection Object that contains ports refs referring to ports of the passed-in EdifCell
See Also:
EdifLibraryManager.findPortRefsOf(byucc.edif.EdifCell)

findCellInstancesOf

public java.util.Collection findCellInstancesOf(EdifCell cell)
This function returns all EdifCellInstances that reference the given in cell in this library. This will only search the current library. If no CellCellInstances are found, this method will return null. This method finds all instanced EdifCell objects (i.e. EdifCellInstances) in the current library.

Parameters:
cell - The cell to find cell instances of
Returns:
A Collection of EdifCellInstance Objects that refer to the passed in EdifCell
See Also:
EdifCell.findCellInstancesOf(byucc.edif.EdifCell)

findCellInstancesOf

public java.util.Collection findCellInstancesOf(EdifLibrary lib)
This function returns all EdifCellInstances that reference cells from the passed-in library. This will only search the current library. If no CellInstances are found, this method will return null. This method finds all instanced EdifCell objects (i.e. EdifCellInstances) in the current library.

Parameters:
lib - The library that contains EdifCells that this method will find the EdifCellInstances of
Returns:
A Collection of EdifCellInstaces that refer to EdifCells in the passed-in library
See Also:
EdifCell.findCellInstancesOf(byucc.edif.EdifCell)

findCellsUsedByInstancesOf

public java.util.Collection findCellsUsedByInstancesOf(EdifCell cell)
This function returns a list of EdifCell objects instanced by the given EdifCell object that are contained in the current library. This is very similar to the EdifCell.getSubCellList() method with the exception that the returned subcells are limited to those that lie within this EdifLibrary.

Parameters:
cell - The cell that contains EdifCellInstances that refer to EdifCells this method returns a Collection of
Returns:
A Collection of EdifCells that are referenced by EdifCellInstances contained within the passed in EdifCell

findCellsUsedByInstancesOf

public java.util.Collection findCellsUsedByInstancesOf(EdifLibrary lib)
This function returns a list of EdifCell objects instanced by EdifCells of the passed-in EdifLibrary Object that are contained in the current library. This is very similar to the EdifCell.getSubCellList() method with the exception that the returned subcells are limited to those that lie within this EdifLibrary.

Parameters:
lib - The library that contains EdifCells that contains EdifCellInstances that refer to EdifCells this method returns a Collection of
Returns:
A Collection of EdifCells that are referenced by EdifCellInstances contained within EdifCells contained within the passed in EdifLibrary

findNonReferencedCells

public java.util.Collection findNonReferencedCells()
This function will return a list of EdifCell objects that are not referenced anywhere within the current Library. These EdifCell objects may be referenced from a different library.

Returns:
A Collection of EdifCells that exist in this library and that aren't referenced from within this library
See Also:
EdifLibraryManager.findNonReferencedCells()

findBlackBoxes

public java.util.Collection findBlackBoxes()
Returns all leafCell, non primitive EdifCell objects within the library. These leafCells are called black boxes.

Returns:
A Collection of EdifCells contained within this library that are leaf cells and aren't primitives, or black boxes
See Also:
EdifLibraryManager.findBlackBoxes()

findMatchingEdifCell

public EdifCell findMatchingEdifCell(EdifCell cell,
                                     boolean equalsNameOnly,
                                     boolean equalsStructure,
                                     boolean equalsInterfaceOnly,
                                     boolean comparePossibleBus,
                                     boolean equalsProperties,
                                     boolean ignoreBusDirection)
Searches the current library for a matching EdifCell. The type of match that is performed is determined by the boolean parameters (see parameter definitions for these rules). For a two EdfiCell objects to match, they must have the same CellInterface and name. If the equalsStructre parameter is true, the cells must also have the same structure.

Parameters:
cell - The foreign EdifCell that this method will search for in the current library.
equalsNameOnly - If true, the match will be found by comparing only the name of cells
equalsStructure - If this parameter is true, the cell structure (i.e. nets and instanced cells) must be the same as well as the interface and possibly name.
equalsInterfaceOnly - If true, the match will be found by comparing only the interface of cells
comparePossibleBus - Compares cell's interface for a possible bus-match
equalsProperties - If true, the property list of each cells must be equal
ignoreBusDirection - If true, all port to bus matches will ignore direction
Returns:
The matching EdifCell object that matches the passed in EdifCell Object
See Also:
EdifCell.busMatch(EdifCell), EdifCell.equals(EdifCell,boolean,boolean), findMatchingEdifCell(EdifCell), EdifLibraryManager.findMatchingEdifCell(EdifCell)

findMatchingEdifCell

public EdifCell findMatchingEdifCell(EdifCell cell,
                                     boolean equalsNameOnly,
                                     boolean equalsStructure,
                                     boolean equalsInterfaceOnly,
                                     boolean comparePossibleBus)
Overloaded method that defaults to not matching cell for properties, and port directions are ignored.

Parameters:
cell - The foreign EdifCell that this method will search for in the current library.
equalsNameOnly - If true, the match will be found by comparing only the name of cells
equalsStructure - If this parameter is true, the cell structure (i.e. nets and instanced cells) must be the same as well as the interface and possibly name.
equalsInterfaceOnly - If true, the match will be found by comparing only the interface of cells
comparePossibleBus - Compares cell's interface for a possible bus-match
Returns:
The matching EdifCell object that matches the passed in EdifCell Object
See Also:
findMatchingEdifCell(EdifCell,boolean,boolean,boolean, boolean,boolean,boolean)

findMatchingEdifCell

public EdifCell findMatchingEdifCell(EdifCell cell,
                                     boolean equalsNameOnly,
                                     boolean equalsStructure,
                                     boolean equalsInterfaceOnly)
Overloaded method that defaults to not matching interface for a possible bus-match.

Parameters:
cell - The foreign EdifCell that this method will search for in the current library.
equalsNameOnly - If true, the match will be found by comparing only the name of cells
equalsStructure - If this parameter is true, the cell structure (i.e. nets and instanced cells) must be the same as well as the interface and possibly name.
equalsInterfaceOnly - If true, the match will be found by comparing only the interface of cells
Returns:
The matching EdifCell object that matches the passed in EdifCell Object
See Also:
findMatchingEdifCell(EdifCell,boolean,boolean,boolean, boolean)

findMatchingEdifCell

public EdifCell findMatchingEdifCell(EdifCell cell)
Overloaded method that defaults to not matching by interface or name only, nor does it check structure.

Parameters:
cell - The EdifCell object to check the match with
Returns:
An EdifCell Object that matches the passed in EdifCell Object
See Also:
findMatchingEdifCell(EdifCell,boolean,boolean,boolean)

findMatchingEdifCells

public java.util.Map findMatchingEdifCells(EdifLibrary lib,
                                           boolean equalsStructure,
                                           boolean comparePossibleBus)
This method will attempt to match all EdifCell objects in the passed in library to matching EdifCell objects in this library. The key of this map is the EdifCell in the passed-in library and the value is the matching EdifCell of this library.

Parameters:
lib - The library to find a mapping with in respect to this library
equalsStructure - If true, cells that match have the same structure as well
comparePossibleBus - Compares cell's interface for a possible bus-match
Returns:
A Map Object which is a mapping between cells that match in the passed in EdifLibrary Object and this EdifLibrary Object
See Also:
EdifLibraryManager.findMatchingEdifCells(EdifLibraryManager, boolean)

findMatchingEdifCells

public java.util.Map findMatchingEdifCells(EdifLibrary lib,
                                           boolean equalsStructure)
Overloaded method defaulting to not comparing EdifCellInterface Objects for a possible bus match.

Parameters:
lib - The library to find a mapping with in respect to this library
equalsStructure - If true, cells that match have the same structure as well
Returns:
A Map Object which is a mapping between cells that match in the passed in EdifLibrary Object and this EdifLibrary Object
See Also:
findMatchingEdifCells(EdifLibrary,boolean,boolean)

getLibraryManager

public EdifLibraryManager getLibraryManager()
Returns this library's library manager.

Returns:
The EdifLibraryManager Object of this EdifLibrary

getCell

public EdifCell getCell(java.lang.String name)
Return the EdifCell object in this library that is associated with the given String name. If no cell with the given name exists in the library, return null.

Parameters:
name - The name of the cell to fetch from this library
Returns:
An EdifCell object whose name equals the passed in String

getCells

public java.util.Collection getCells()
Returns the EdifCell Objects in this library.

Returns:
A Collection object of the EdifCell Objects in this EdifLibrary

getNameSpaceResolver

public NameSpaceResolver getNameSpaceResolver()

getNextCells

public java.util.Collection getNextCells(EdifCell cell)
Return the collection of cells that are defined after the specified cell in the libarary.

Parameters:
cell - The cell that designates the point after which cells will begin to be returned
Returns:
A Collection of EdifCell objects defined after the passed-in EdifCell Object

getPreviousCells

public java.util.Collection getPreviousCells(EdifCell cell)
Return the collection of cells that are defined before the specified cell in the libarary.

Parameters:
cell - The cell that designates the point where the list of cells stops
Returns:
A Collection of EdifCell objects defined before the passed-in EdifCell Object

isExternal

public boolean isExternal()
Indicates whether this library was tagged with the
external
tag.

Returns:
True if this is an external library

isPrimitiveLibrary

public boolean isPrimitiveLibrary()
This method will examine each of the EdifCell objects in the library and determine if every EdifCell in the library is a primitive (see EdifCell.isLeafCell()). If every EdifCell is a primitive, then this method will return true. Otherwise, it will return false.

In most cases, library primitives are grouped together in a single library. It may be necessary to find a library of primitives when trying to determine the proper library to add a primitive into the design.

Returns:
True if this library contains only primitive cells

iterator

public java.util.Iterator iterator()
Return a Collection of EdifCell objects contained by this library.

Returns:
An Iterator Object of the EdifCells in this library

isValid

public boolean isValid()
Verify that the Manager is valid (The ordering of the cells are OK).

Returns:
True if this is a valid library

modifySinglePortsToBus

void modifySinglePortsToBus(java.util.Collection oldPorts,
                            EdifPort newPort)
Modifies any references from oldPorts to newPort.

Parameters:
oldPorts - A Collection of EdifPort Objects to update
newPort - The EdifPort Object to have the old ones point to
See Also:
EdifCell.modifySinglePortsToBus(java.util.Collection, byucc.edif.EdifPort)

modifyBusToSinglePorts

void modifyBusToSinglePorts(EdifPort oldPort,
                            java.util.Collection newPorts)
Modifies any references from oldPort to the correct EdifPort in newPorts.

Parameters:
oldPort - The old EdifPort to update
newPorts - The Collection of EdifPort Objects to have the old ones point to
See Also:
EdifCell.modifyBusToSinglePorts(byucc.edif.EdifPort, java.util.Collection)

nameClash

public boolean nameClash(EdifCell cell)
Returns whether or not the given string name will clash with another EdifCell's name.

Parameters:
cell - The EdifCell whose name will be checked against the names contained within the name space of EdifCell Objects
Returns:
true if the name of this EdifCell already exists in the current list of EdifCells

setLibraryManager

public void setLibraryManager(EdifLibraryManager libMan)
Sets this library's library manager to libMan.

Parameters:
libMan - The library manager of this library

tagLeafCellsAsPrimitives

public void tagLeafCellsAsPrimitives()
Tags all leaf cells as primitive.


tagPrimitives

public void tagPrimitives(EdifLibrary primitives)
Tags primitives in this library based on whether or not they match cells in the passed in library.

Parameters:
primitives - The library that contains primitives that will be compared against all cells in this library to match with primitives

toEdif

public void toEdif(EdifPrintWriter epw)
Converts this object to EDIF format and writes it to the passed-in EdifPrintWriter Object.

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

toString

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

Returns:
A String representing this EdifLibrary Objects name, and contained EdifCell Objects

trimToSize

public void trimToSize()
Trims this EdifLibrary Object and and contained Trimmable Objects down to size.

Specified by:
trimToSize in interface Trimable

validateOrder

public void validateOrder()
Re-orders the cells into a proper order (if they aren't already).