com.sun.electric.database.prototype
Interface NodeProto

All Known Implementing Classes:
Cell, PrimitiveNode

public interface NodeProto

The NodeProto interface defines a type of NodeInst. It can be implemented as PrimitiveNode (for primitives from Technologies) or as Cell (for cells in Libraries).

Every node in the database appears as one prototypical object and many instantiative objects. Thus, for a PrimitiveNode such as the CMOS P-transistor there is one object (called a PrimitiveNode, which is a NodeProto) that describes the transistor prototype and there are many objects (called NodeInsts), one for every instance of a transistor that appears in a circuit. Similarly, for every Cell, there is one object (called a Cell, which is a NodeProto) that describes the Cell with everything in it and there are many objects (also called NodeInsts) for every use of that Cell in some other Cell. PrimitiveNodes are statically created and placed in the Technology objects, but complex Cells are created by the tools and placed in Library objects.

The basic NodeProto has a list of varibales, a list of ports, the bounds and much more.


Method Summary
 java.lang.String describe(boolean withQuotes)
          Method to describe this NodeProto as a string.
 PortProto findPortProto(Name name)
          Method to find the PortProto that has a particular Name.
 PortProto findPortProto(java.lang.String name)
          Method to find the PortProto that has a particular name.
 double getDefHeight()
          Method to return the default height of this NodeProto.
 double getDefWidth()
          Method to return the default width of this NodeProto.
 PrimitiveNode.Function getFunction()
          Method to return the function of this NodeProto.
 NodeProtoId getId()
          Method to return NodeProtoId of this NodeProto.
 java.lang.String getName()
          Method to return the name of this NodeProto.
 int getNumPorts()
          Method to return the number of PortProtos on this NodeProto.
 PortProto getPort(int portIndex)
          Method to return the PortProto at specified position.
 PortProto getPort(PortProtoId portProtoId)
          Method to return the PortProto by thread-independent PortProtoId.
 java.util.Iterator<PortProto> getPorts()
          Method to return an iterator over all PortProtos of this NodeProto.
 SizeOffset getProtoSizeOffset()
          Method to size offset of this NodeProto.
 Technology getTechnology()
          Method to return the Technology to which this NodeProto belongs.
 

Method Detail

getId

NodeProtoId getId()
Method to return NodeProtoId of this NodeProto. NodeProtoId identifies NodeProto independently of threads.

Returns:
NodeProtoId of this NodeProto.

getFunction

PrimitiveNode.Function getFunction()
Method to return the function of this NodeProto. The Function is a technology-independent description of the behavior of this NodeProto.

Returns:
the function of this NodeProto.

getDefWidth

double getDefWidth()
Method to return the default width of this NodeProto. Cells return the actual width of the contents. PrimitiveNodes return the default width of new instances of this NodeProto.

Returns:
the width to use when creating new NodeInsts of this NodeProto.

getDefHeight

double getDefHeight()
Method to return the default height of this NodeProto. Cells return the actual height of the contents. PrimitiveNodes return the default height of new instances of this NodeProto.

Returns:
the height to use when creating new NodeInsts of this NodeProto.

getProtoSizeOffset

SizeOffset getProtoSizeOffset()
Method to size offset of this NodeProto.

Returns:
the size offset of this NodeProto. It is always zero for cells.

getTechnology

Technology getTechnology()
Method to return the Technology to which this NodeProto belongs. For Cells, the Technology varies with the View and contents. For PrimitiveNodes, the Technology is simply the one that owns it.

Returns:
the Technology associated with this NodeProto.

findPortProto

PortProto findPortProto(java.lang.String name)
Method to find the PortProto that has a particular name.

Returns:
the PortProto, or null if there is no PortProto with that name.

findPortProto

PortProto findPortProto(Name name)
Method to find the PortProto that has a particular Name.

Returns:
the PortProto, or null if there is no PortProto with that name.

getPorts

java.util.Iterator<PortProto> getPorts()
Method to return an iterator over all PortProtos of this NodeProto.

Returns:
an iterator over all PortProtos of this NodeProto.

getNumPorts

int getNumPorts()
Method to return the number of PortProtos on this NodeProto.

Returns:
the number of PortProtos on this NodeProto.

getPort

PortProto getPort(int portIndex)
Method to return the PortProto at specified position.

Parameters:
portIndex - specified position of PortProto.
Returns:
the PortProto at specified position..

getPort

PortProto getPort(PortProtoId portProtoId)
Method to return the PortProto by thread-independent PortProtoId.

Parameters:
portProtoId - thread-independent PortProtoId.
Returns:
the PortProto.

describe

java.lang.String describe(boolean withQuotes)
Method to describe this NodeProto as a string. PrimitiveNodes may prepend their Technology name if it is not the current technology (for example, "mocmos:N-Transistor"). Cells may prepend their Library if it is not the current library, and they will include view and version information (for example: "Wires:wire100{ic}").

Parameters:
withQuotes - to wrap description between quotes
Returns:
a String describing this NodeProto.

getName

java.lang.String getName()
Method to return the name of this NodeProto. When this is a PrimitiveNode, the name is just its name in the Technology. When this is a Cell, the name is the pure cell name, without any view or version information.

Returns:
the prototype name of this NodeProto.