|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectbyucc.edif.NamedPropertyObject
byucc.edif.EdifLibrary
public class EdifLibrary
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:
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. |
| 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. |
boolean |
deleteCell(EdifCell cell,
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. |
int |
findEarliestPositionToAdd(EdifCell cell)
This method will find the earliest position in the library in which the given EdifCell can be added. |
java.util.Collection |
findInstancedLibraryCells(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 |
findInstancedLibraryCells(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 |
findLatestPositionToAdd(EdifCell cell)
This method will find the latest position in the library in which the given EdifCell can be added. |
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. |
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, copyProperties, equals, equalsProperties, getEdifNameable, getName, getOldName, getProperty, getPropertyList, rename, rename |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private ArrayListNameSpaceResolver _edifCells
private boolean _external
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.
private EdifLibraryManager _edifLibraryManager
| Constructor Detail |
|---|
public EdifLibrary(java.lang.String name)
name - The name of the new EdifLibrary Objectpublic EdifLibrary(EdifNameable name)
name - The name-holding information Object of the new
EdifLibrary Object
public EdifLibrary(java.lang.String name,
boolean external)
name - The name of the new EdifLibrary Objectexternal - True if this is an External library
public EdifLibrary(EdifNameable name,
boolean external)
name - The name-holding information Object of the new
EdifLibrary Objectexternal - True if this is an External library| Method Detail |
|---|
public boolean addCell(EdifCell cell)
cell - The EdifCell to add to this EdifLibrary
addCell(EdifCell,boolean)
public boolean addCell(EdifCell cell,
boolean earliest)
cell - The EdifCell to add to this EdifLibraryearliest - If true then place the given cell at the
earliest location in the library. If false, place at the latest
location in the library
public boolean containsCell(EdifCell cell)
cell - The cell to check whether or not it exists in this
EdifLibrary
public boolean containsCellByName(java.lang.String name)
name - The name of the cell to see if it exists by name
within this EdifLibrary
public boolean containsClashingCell(EdifCell cell)
cell - The cell to match up with among the cells in this
library to see if a clashing cell exists
public boolean deleteCell(EdifCell cell,
boolean force)
cell - The cell to be deleted.force - Forces the cell to be deleted even if it's still
referenced within the library.
protected boolean deleteCellAux(EdifCell cell)
cell - The cell to be deleted.
deleteCell(EdifCell,boolean)public int findEarliestPositionToAdd(EdifCell cell)
Note that this method will ignore EdifCellInstances of the given EdifCell that are not defined in this library.
cell - The cell to add.
EdifLibraryManager.findEarliestLibraryToAdd(byucc.edif.EdifCell, boolean)public int findLatestPositionToAdd(EdifCell cell)
cell - The cell to add.
EdifLibraryManager.findLatestLibraryToAdd(byucc.edif.EdifCell, boolean)public java.util.Collection findPortRefsOf(EdifCell cell)
cell - The cell who has the ports to check the port
references for.
EdifLibraryManager#findPortRefsOfpublic java.util.Collection findCellInstancesOf(EdifCell cell)
cell - The cell to find cell instances of
EdifCell.findCellInstancesOf(byucc.edif.EdifCell)public java.util.Collection findCellInstancesOf(EdifLibrary lib)
lib - The library that contains EdifCells that this method
will find the EdifCellInstances of
EdifCell.findCellInstancesOf(byucc.edif.EdifCell)public java.util.Collection findInstancedLibraryCells(EdifCell cell)
EdifCell.getSubCellList() method with the exception that
the returned subcells are limited to those that lie within
this EdifLibrary.
cell - The cell that contains EdifCellInstances that refer
to EdifCells this method returns a Collection of
public java.util.Collection findInstancedLibraryCells(EdifLibrary lib)
EdifCell.getSubCellList() method with the exception that the
returned subcells are limited to those that lie within this
EdifLibrary.
lib - The library that contains EdifCells that contains
EdifCellInstances that refer to EdifCells this method returns a
Collection of
public java.util.Collection findNonReferencedCells()
EdifLibraryManager.findNonReferencedCells()public java.util.Collection findBlackBoxes()
EdifLibraryManager.findBlackBoxes()public EdifLibraryManager getLibraryManager()
public EdifCell getCell(java.lang.String name)
name - The name of the cell to fetch from this library
public java.util.Collection getCells()
public NameSpaceResolver getNameSpaceResolver()
public java.util.Collection getNextCells(EdifCell cell)
cell - The cell that designates the point after which
cells will begin to be returned
public java.util.Collection getPreviousCells(EdifCell cell)
cell - The cell that designates the point where the list
of cells stops
public boolean isExternal()
externaltag.
public boolean isPrimitiveLibrary()
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.
public java.util.Iterator iterator()
public boolean isValid()
public boolean nameClash(EdifCell cell)
cell - The EdifCell whose name will be checked against the
names contained within the name space of EdifCell Objects
public void setLibraryManager(EdifLibraryManager libMan)
libMan - The library manager of this librarypublic void tagLeafCellsAsPrimitives()
public void tagPrimitives(EdifLibrary primitives)
primitives - The library that contains primitives that
will be compared against all cells in this library to match with
primitivespublic void toEdif(EdifPrintWriter epw)
toEdif in interface EdifOutepw - The EdifPrinterWriter Object that the EDIF data will
be written topublic java.lang.String toString()
toString in class java.lang.Objectpublic void trimToSize()
trimToSize in interface Trimablepublic void validateOrder()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||