com.sun.electric.database.id
Class CellId

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

public final class CellId
extends java.lang.Object
implements NodeProtoId, java.io.Serializable

The CellId class identifies a type of NodeInst independently of threads. It differs from Cell objects, which will be owned by threads in transactional database. This class is thread-safe except inCurrentThread method in 1.5, but not thread-safe in 1.4 .

See Also:
Serialized Form

Field Summary
 int cellIndex
          Unique index of this cell in the database.
 CellName cellName
          CellName of this CellId.
 IdManager idManager
          IdManager which owns this LibId.
 LibId libId
          LibId which owns this CellId.
static CellId[] NULL_ARRAY
          Empty CellId array for initialization.
 
Method Summary
 IdManager getIdManager()
          Returns IdManager which is owner of this CellId.
 ExportId getPortId(int chronIndex)
          Returns ExportId in this parent cell with specified chronological index.
 CellUsage getUsageIn(CellId protoId)
          Returns CellUsage with this CellId as a parent cell and with given CellId as a proto subcell.
 CellUsage getUsageIn(int i)
          Returns the i-th in cronological order CellUsage with this CellId as a parent cell.
 CellUsage getUsageOf(int i)
          Returns the i-th in cronological order CellUsage with this CellId as a proto subcell.
 Cell inDatabase(EDatabase database)
          Method to return the Cell representing CellId in the specified EDatabase.
 boolean isIcon()
          Method to determine whether this CellId is an id of an icon Cell.
 boolean isSchematic()
          Method to determine whether this CellId is an id of an schematic Cell.
static void main(java.lang.String[] args)
           
 int newArcId()
          Returns new arcId unique for this CellId.
 int newNodeId()
          Returns new nodeId unique for this CellId.
 ExportId newPortId(java.lang.String externalId)
          Returns ExportId in this parent cell with specified external id.
 int numExportIds()
          Returns a number ExportIds in this parent cell.
 int numUsagesIn()
          Returns a number CellUsages with this CellId as a parent cell.
 int numUsagesOf()
          Returns a number CellUsages whith this CellId as a proto subcell.
 ExportId randomExportId(java.lang.String suggestedId)
          Creates new random exportId, unique in this session for this parent CellId.
 java.lang.String toString()
          Returns a printable version of this CellId.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_ARRAY

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


idManager

public final IdManager idManager
IdManager which owns this LibId.


libId

public final LibId libId
LibId which owns this CellId.


cellName

public final CellName cellName
CellName of this CellId.


cellIndex

public final int cellIndex
Unique index of this cell in the database.

Method Detail

getIdManager

public IdManager getIdManager()
Returns IdManager which is owner of this CellId.

Returns:
IdManager which is owner of this CellId.

numUsagesIn

public int numUsagesIn()
Returns a number CellUsages with this CellId as a parent cell. This number may grow in time.

Returns:
a number CellUsages with this CellId as a parent cell.

getUsageIn

public CellUsage getUsageIn(int i)
Returns the i-th in cronological order CellUsage with this CellId as a parent cell.

Parameters:
i - chronological number of CellUsage.
Returns:
i-th CellUsage with this CellId as a parent cell.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if no such CellUsage.

numUsagesOf

public int numUsagesOf()
Returns a number CellUsages whith this CellId as a proto subcell. This mumber may grow in time.

Returns:
a number CellUsages whith this CellId as a proto subcell.

getUsageOf

public CellUsage getUsageOf(int i)
Returns the i-th in cronological order CellUsage with this CellId as a proto subcell.

Parameters:
i - chronological number of CellUsage.
Returns:
i-th CellUsage with this CellId as a proto subcell.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if no such CellUsage.

getUsageIn

public CellUsage getUsageIn(CellId protoId)
Returns CellUsage with this CellId as a parent cell and with given CellId as a proto subcell. If this pair of cells is requested at a first time, the new CellUsage is created, otherwise the early created CellUsage retruned.

Parameters:
protoId - CellId of proto subcell.
Returns:
CellUsage with this CellId as parent and protoId as a proto subcell.
Throws:
java.lang.NullPointerException - if prootId is null.

numExportIds

public int numExportIds()
Returns a number ExportIds in this parent cell. This number may grow in time.

Returns:
a number of ExportIds.

getPortId

public ExportId getPortId(int chronIndex)
Returns ExportId in this parent cell with specified chronological index.

Specified by:
getPortId in interface NodeProtoId
Parameters:
chronIndex - chronological index of ExportId.
Returns:
ExportId with specified chronological index.
Throws:
java.lang.ArrayIndexOutOfBoundsException - if no such ExportId.

newPortId

public ExportId newPortId(java.lang.String externalId)
Returns ExportId in this parent cell with specified external id. If this external id was requested earlier, the previously created ExportId returned, otherwise the new ExportId is created.

Specified by:
newPortId in interface NodeProtoId
Parameters:
externalId - external id of ExportId.
Returns:
ExportId with specified external id.
Throws:
java.lang.NullPointerException - if externalId is null.

randomExportId

public ExportId randomExportId(java.lang.String suggestedId)
Creates new random exportId, unique in this session for this parent CellId.

Parameters:
suggestedId - suggested external id
Returns:
new exportId.

newNodeId

public int newNodeId()
Returns new nodeId unique for this CellId.

Returns:
new nodeId unique for this CellId.

newArcId

public int newArcId()
Returns new arcId unique for this CellId.

Returns:
new arcId unique for this CellId.

inDatabase

public Cell inDatabase(EDatabase database)
Method to return the Cell representing CellId in the specified EDatabase.

Specified by:
inDatabase in interface NodeProtoId
Parameters:
database - EDatabase where to get from.
Returns:
the Cell representing CellId in the specified database. This method is not properly synchronized.

toString

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

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

isIcon

public boolean isIcon()
Method to determine whether this CellId is an id of an icon Cell.

Returns:
true if this CellId is an id of an icon Cell.

isSchematic

public boolean isSchematic()
Method to determine whether this CellId is an id of an schematic Cell.

Returns:
true if this CellId is an id of an schematic Cell.

main

public static void main(java.lang.String[] args)