|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.electric.database.variable.ElectricObject
com.sun.electric.database.hierarchy.Library
public class Library
A Library represents a collection of Cells. To find of a Library, you use Electric.getLibrary(String name). Use Electric.newLibrary(String name) to create a new library, or Electric.getCurrent() to get the current Library.
Once you have a Library, you can create a new Cell in it, find an existing Cell, get an Enumeration of all Cells, or find the Cell that the user is currently editing.
Field Summary | |
---|---|
static Variable.Key |
FONT_ASSOCIATIONS
key of Variable holding font associations. |
static int |
HIDDENLIBRARY
library is "hidden" (clipboard library) |
Method Summary | |
---|---|
void |
addVar(Variable var)
Method to add a Variable on this Library. |
LibraryBackup |
backup()
|
protected void |
check()
Method to check invariants in this Library. |
int |
checkAndRepair(boolean repair,
ErrorLogger errorLogger)
Method to check and repair data structure errors in this Library. |
void |
clearChanged()
Method to indicate that this Library has not changed. |
void |
clearFromDisk()
Method to indicate that this Library did not come from disk. |
void |
clearHidden()
Method to indicate that this Library is not hidden. |
int |
compareTo(Library that)
Compares two Library objects. |
void |
delVar(Variable.Key key)
Method to delete a Variable from this Library. |
void |
erase()
Method to remove all contents from this Library. |
static Cell |
findCellInLibraries(java.lang.String cellName,
View view,
java.lang.String libraryName)
|
static Library |
findLibrary(java.lang.String libName)
Method to find a Library with the specified name. |
Cell |
findNodeProto(java.lang.String name)
Method to find the Cell with the given name in this Library. |
static java.util.Set<Cell> |
findReferenceInCell(Library elib)
Get list of cells contained in other libraries that refer to cells contained in this library |
java.util.Iterator<Cell> |
getCells()
Method to return an Iterator over all Cells in this Library. |
Cell |
getCurCell()
Method to get the current Cell in this Library. |
static Library |
getCurrent()
Method to return the current Library. |
ImmutableLibrary |
getD()
Returns persistent data of this Library. |
EDatabase |
getDatabase()
Returns database to which this Library belongs. |
java.util.Set<java.lang.String> |
getDelibCellFiles()
Returns DELIB cell files. |
LibId |
getId()
Method to return LibId of this Library. |
java.net.URL |
getLibFile()
Method to return the URL of this Library. |
static java.util.Iterator<Library> |
getLibraries()
Method to return an iterator over all libraries. |
java.lang.String |
getName()
Method to return the name of this Library. |
int |
getNumCells()
|
static int |
getNumLibraries()
Method to return the number of libraries. |
Pref.Group |
getPrefs()
Method to get the Preferences associated with this Library. |
Version |
getVersion()
Returns verison of Electric which wrote this library. |
static java.util.List<Library> |
getVisibleLibraries()
Method to return an iterator over all visible libraries. |
static Library |
inCurrentThread(LibId libId)
Returns a Library by LibId. |
boolean |
isChanged()
Method to return true if this Library has changed. |
boolean |
isFromDisk()
Method to return true if this Library came from disk. |
boolean |
isHidden()
Method to return true if this Library is hidden. |
boolean |
isLinked()
Returns true if this Library is linked into database. |
boolean |
kill(java.lang.String reason)
Method to delete this Library. |
int |
lowLevelGetUserBits()
Low-level method to get the user bits. |
void |
lowLevelSetUserBits(int userBits)
Low-level method to set the user bits. |
static Library |
newInstance(java.lang.String libName,
java.net.URL libFile)
This method is a factory to create new libraries. |
boolean |
referencesLib(Library lib)
Returns true if this Library directly references the specified Library 'lib'. |
static void |
repairAllLibraries()
|
static void |
saveExpandStatus()
Method to save isExpanded status of NodeInsts in this Library to Preferences. |
void |
setChanged()
Method to indicate that this Library has changed. |
void |
setCurCell(Cell curCell)
Method to set the current Cell in this Library. |
void |
setCurrent()
Method to make this the current Library. |
void |
setDelibCellFiles(java.util.HashSet<java.lang.String> delibCellFiles)
Sets DELIB cell files. |
void |
setFromDisk()
Method to indicate that this Library came from disk. |
void |
setHidden()
Method to indicate that this Library is hidden. |
void |
setLibFile(java.net.URL libFile)
Method to set the URL of this Library. |
IdMapper |
setName(java.lang.String libName)
Method to set the name of this Library. |
void |
setVersion(Version version)
Method to set library version found in header. |
java.lang.String |
toString()
Returns a printable version of this Library. |
Methods inherited from class com.sun.electric.database.variable.ElectricObject |
---|
addDisplayableVariables, checkChanging, checkExamine, checkUndoing, computeTextPoly, copyTextDescriptorFrom, copyVarsFrom, getArtwork, getCode, getDisplayableVariables, getGeneric, getInfo, getMutableTextDescriptor, getNumVariables, getParameterOrVariable, getParameterOrVariable, getParametersAndVariables, getPolyList, getSchematics, getTech, getTechPool, getTextBounds, getTextDescriptor, getVar, getVar, getVariables, getVarValue, getVarValue, isDatabaseObject, isDeprecatedVariable, isParam, newDisplayVar, newVar, newVar, newVar, newVar, numDisplayableVariables, renameVar, renameVar, setOff, setTextDescriptor, uniqueObjectName, uniqueObjectName, updateVar, updateVarCode, updateVarText, whichCell |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final Variable.Key FONT_ASSOCIATIONS
public static final int HIDDENLIBRARY
Method Detail |
---|
public static Library newInstance(java.lang.String libName, java.net.URL libFile)
libName
- the name of the library (for example, "gates").
Library names must be unique, and they must not contain spaces or colons.libFile
- the URL to the disk file (for example "/home/strubin/gates.elib").
If the Library is being created, the libFile can be null.
If the Library file is given and it points to an existing file, then the I/O system
can be told to read that file and populate the Library.
public boolean kill(java.lang.String reason)
reason
- the reason for deleting this library (replacement or deletion).
public void erase()
public boolean referencesLib(Library lib)
lib
- the possible referenced library
public ImmutableLibrary getD()
getD
in class ElectricObject
public void addVar(Variable var)
addVar
in class ElectricObject
var
- Variable to add.public void delVar(Variable.Key key)
delVar
in class ElectricObject
key
- the key of the Variable to delete.public LibId getId()
public static Library inCurrentThread(LibId libId)
libId
- LibId to find.
public boolean isLinked()
isLinked
in class ElectricObject
public EDatabase getDatabase()
getDatabase
in class ElectricObject
public LibraryBackup backup()
public static void repairAllLibraries()
public int checkAndRepair(boolean repair, ErrorLogger errorLogger)
protected void check()
check
in class ElectricObject
java.lang.AssertionError
- if invariants are not validpublic void setChanged()
public void clearChanged()
public boolean isChanged()
public void setFromDisk()
public void clearFromDisk()
public boolean isFromDisk()
public void setHidden()
public void clearHidden()
public boolean isHidden()
public static Library getCurrent()
public void setCurrent()
public Pref.Group getPrefs()
public int lowLevelGetUserBits()
public void lowLevelSetUserBits(int userBits)
userBits
- the new "user bits".public static java.util.Set<Cell> findReferenceInCell(Library elib)
elib
- to search for
public static Library findLibrary(java.lang.String libName)
libName
- the name of the Library.
Note that this is the Library name, and not the Library file.
public static java.util.Iterator<Library> getLibraries()
public static int getNumLibraries()
public static java.util.List<Library> getVisibleLibraries()
public java.lang.String getName()
public IdMapper setName(java.lang.String libName)
libName
- the new name of this Library.
public java.net.URL getLibFile()
public void setLibFile(java.net.URL libFile)
libFile
- the new URL of this Library.public int compareTo(Library that)
Library
objects.
compareTo
in interface java.lang.Comparable<Library>
that
- the Library to be compared.
public java.lang.String toString()
toString
in class ElectricObject
public Cell getCurCell()
public void setCurCell(Cell curCell)
curCell
- the new current Cell in this Library.public static void saveExpandStatus() throws java.util.prefs.BackingStoreException
java.util.prefs.BackingStoreException
public static Cell findCellInLibraries(java.lang.String cellName, View view, java.lang.String libraryName)
public Cell findNodeProto(java.lang.String name)
name
- the name of the desired Cell.
public int getNumCells()
public java.util.Iterator<Cell> getCells()
public Version getVersion()
public void setVersion(Version version)
version
- public java.util.Set<java.lang.String> getDelibCellFiles()
public void setDelibCellFiles(java.util.HashSet<java.lang.String> delibCellFiles)
delibCellFiles
- DELIB cell files.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |