com.sun.electric.database.id
Class LibId

java.lang.Object
  extended by com.sun.electric.database.id.LibId
All Implemented Interfaces:
java.io.Serializable

public final class LibId
extends java.lang.Object
implements java.io.Serializable

The LibId immutable class identifies library independently of threads. It differs from Library objects, which will be owned by threads in transactional database. This class is thread-safe except inCurrentThread method.

See Also:
Serialized Form

Field Summary
 IdManager idManager
          IdManager which owns this LibId.
 int libIndex
          Unique index of this lib in the database.
 java.lang.String libName
          Library name
static LibId[] NULL_ARRAY
          Empty LibId array for initialization.
 
Method Summary
 Library inDatabase(EDatabase database)
          Method to return the Library representing LibId in the specified EDatabase.
static java.lang.String legalLibraryName(java.lang.String libName)
          Checks that string is legal library name.
 CellId newCellId(CellName cellName)
          Returns new CellId with cellIndex unique in this IdManager.
 java.lang.String toString()
          Returns a printable version of this LibId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_ARRAY

public static final LibId[] NULL_ARRAY
Empty LibId array for initialization.


idManager

public final IdManager idManager
IdManager which owns this LibId.


libName

public final java.lang.String libName
Library name


libIndex

public final int libIndex
Unique index of this lib in the database.

Method Detail

newCellId

public CellId newCellId(CellName cellName)
Returns new CellId with cellIndex unique in this IdManager.

Returns:
new CellId.

inDatabase

public Library inDatabase(EDatabase database)
Method to return the Library representing LibId in the specified EDatabase.

Parameters:
database - EDatabase where to get from.
Returns:
the Library representing LibId in the specified database. This method is not properly synchronized.

toString

public java.lang.String toString()
Returns a printable version of this LibId.

Overrides:
toString in class java.lang.Object
Returns:
a printable version of this LibId.

legalLibraryName

public static java.lang.String legalLibraryName(java.lang.String libName)
Checks that string is legal library name. If not, tries to convert string to legal library name.

Parameters:
libName - specified library name.
Returns:
legal library name obtained from specified library name, or null if speicifed name is null or empty.