public class ImmutableNodeInst extends ImmutableElectricObject
Modifier and Type | Class and Description |
---|---|
static class |
ImmutableNodeInst.Flag
Class to access user bits of ImmutableNodeInst.
|
Modifier and Type | Field and Description |
---|---|
EPoint |
anchor
anchor coordinate of this ImmutableNodeInst.
|
static ImmutableArrayList<ImmutableNodeInst> |
EMPTY_LIST |
static ImmutableNodeInst.Flag |
HARD_SELECT
Method to set an ImmutableNodeInst to be hard-to-select.
|
static ImmutableNodeInst.Flag |
LOCKED
Method to set this ImmutableNodeInst to be locked.
|
Name |
name
name of this ImmutableNodeInst.
|
TextDescriptor |
nameDescriptor
The text descriptor of name of ImmutableNodeInst.
|
int |
nodeId
id of this NodeInst in parent.
|
static ImmutableNodeInst[] |
NULL_ARRAY |
Orientation |
orient
Orientation of this ImmutableNodeInst.
|
TextDescriptor |
protoDescriptor
Text descriptor of prototype name.
|
NodeProtoId |
protoId
Prototype id.
|
static boolean |
SIMPLE_TRACE_SIZE |
EPoint |
size
size of this ImmutableNodeInst.
|
byte |
techBits
Tech specifiic bits for this ImmutableNodeInsts.
|
static ImmutableNodeInst.Flag |
VIS_INSIDE
Flag to set an ImmutableNodeInst to be visible-inside.
|
flags
Modifier and Type | Method and Description |
---|---|
void |
check()
Checks invariant of this ImmutableNodeInst.
|
void |
computeBounds(NodeInst real,
java.awt.geom.Rectangle2D.Double dstBounds) |
boolean |
equalsExceptVariables(ImmutableElectricObject o)
Indicates whether fields of other ImmutableElectricObject are equal to fileds of this object.
|
static int |
flagsFromElib(int elibBits)
Get flag bits from ELIB user bits.
|
double[] |
getArcDegrees()
Method to return the starting and ending angle of an arc described by this Immutab;eNodeInst.
|
int |
getElibBits()
Returns ELIB user bits of this ImmutableNodeInst in ELIB.
|
ImmutablePortInst |
getPortInst(PortProtoId portProtoId)
Returns ImmutablePortInst of this ImmutableNodeInst with the specified PortProtoId.
|
java.util.Iterator<PortProtoId> |
getPortsWithVariables()
Returns an Iterator over all PortProtoIds such that the correspondent PortInst on this
ImmutablePortInst has variables.
|
double |
getSerpentineTransistorLength()
Method to return the length of this serpentine transistor.
|
EPoint[] |
getTrace()
Method to return the "outline" information on this ImmutableNodeInst.
|
int |
hashCodeExceptVariables()
Return a hash code value for fields of this object.
|
boolean |
hasPortInstVariables()
Returns true if this ImmutableNodeInst has variables on port instances.
|
boolean |
is(ImmutableNodeInst.Flag flag)
Tests specific flag is set on this ImmutableNodeInst.
|
static boolean |
isCellCenter(NodeProtoId protoId) |
boolean |
isEasyShape()
Returns true if this ImmutableNodeInst doesn't have customized contact variables.
|
boolean |
isUsernamed()
Retruns true if this ImmutableNodeInst was named by user.
|
static ImmutableNodeInst |
newInstance(int nodeId,
NodeProtoId protoId,
Name name,
TextDescriptor nameDescriptor,
Orientation orient,
EPoint anchor,
EPoint size,
int flags,
int techBits,
TextDescriptor protoDescriptor)
Returns new ImmutableNodeInst or ImmutableIconInst object.
|
static int |
techSpecificFromElib(int elibBits)
Get tech specific bits from ELIB user bits.
|
ImmutableNodeInst |
withAnchor(EPoint anchor)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by anchor point.
|
ImmutableNodeInst |
withFlag(ImmutableNodeInst.Flag flag,
boolean value)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by flag bit.
|
ImmutableNodeInst |
withName(Name name)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by name.
|
ImmutableNodeInst |
withNameDescriptor(TextDescriptor nameDescriptor)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by name descriptor.
|
ImmutableNodeInst |
withOrient(Orientation orient)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by orientation.
|
ImmutableNodeInst |
withoutVariable(Variable.Key key)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by removing Variable
with the specified key.
|
ImmutableNodeInst |
withPortInst(PortProtoId portProtoId,
ImmutablePortInst portInst)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by additional Variable on PortInst.
|
ImmutableNodeInst |
withProtoDescriptor(TextDescriptor protoDescriptor)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by proto descriptor.
|
ImmutableNodeInst |
withSize(EPoint size)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by size.
|
ImmutableNodeInst |
withStateBits(ImmutableNodeInst d)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by state bits.
|
ImmutableNodeInst |
withTechSpecific(int techBits)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by tech specific bits.
|
ImmutableNodeInst |
withVariable(Variable var)
Returns ImmutableNodeInst which differs from this ImmutableNodeInst by additional Variable.
|
getNumVariables, getVar, getVar, getVariables, getVarValue, searchVar, toVariableArray
public static final boolean SIMPLE_TRACE_SIZE
public static final ImmutableNodeInst.Flag HARD_SELECT
public static final ImmutableNodeInst.Flag VIS_INSIDE
public static final ImmutableNodeInst.Flag LOCKED
public static final ImmutableNodeInst[] NULL_ARRAY
public static final ImmutableArrayList<ImmutableNodeInst> EMPTY_LIST
public final int nodeId
public final NodeProtoId protoId
public final Name name
public final TextDescriptor nameDescriptor
public final Orientation orient
public final EPoint anchor
public final EPoint size
public final byte techBits
public final TextDescriptor protoDescriptor
public static ImmutableNodeInst newInstance(int nodeId, NodeProtoId protoId, Name name, TextDescriptor nameDescriptor, Orientation orient, EPoint anchor, EPoint size, int flags, int techBits, TextDescriptor protoDescriptor)
nodeId
- id of this NodeInst in parent.protoId
- the NodeProtoId of which this is an instance.name
- name of new ImmutableNodeInst.nameDescriptor
- TextDescriptor of name of this ImmutableNodeInst.orient
- Orientation of this ImmutableNodeInst.anchor
- the anchor location of this ImmutableNodeInst.size
- the size of this ImmutableNodeInst.flags
- flags of this NodeInst.techBits
- bits associated to different technologiesprotoDescriptor
- TextDescriptor of name of this ImmutableNodeInstjava.lang.NullPointerException
- if protoId, name, orient or anchor is null.java.lang.IllegalArgumentException
- if nodeId or size is bad.public ImmutableNodeInst withName(Name name)
name
- node name key.java.lang.NullPointerException
- if name is null.public ImmutableNodeInst withNameDescriptor(TextDescriptor nameDescriptor)
nameDescriptor
- TextDescriptor of namepublic ImmutableNodeInst withOrient(Orientation orient)
orient
- Orientation.java.lang.NullPointerException
- if orient is null.public ImmutableNodeInst withAnchor(EPoint anchor)
anchor
- node anchor point.java.lang.NullPointerException
- if anchor is null.public ImmutableNodeInst withSize(EPoint size)
size
- a point with x as size and y as height.java.lang.IllegalArgumentException
- if width or height is negative.public ImmutableNodeInst withStateBits(ImmutableNodeInst d)
d
- another ImmutableNodeInst where to take state bits.public ImmutableNodeInst withFlag(ImmutableNodeInst.Flag flag, boolean value)
flag
- Flag selector.value
- new value of flag.public ImmutableNodeInst withTechSpecific(int techBits)
techBits
- the Technology-specific value to store on this NodeInst.public ImmutableNodeInst withProtoDescriptor(TextDescriptor protoDescriptor)
protoDescriptor
- TextDescriptor of protopublic ImmutableNodeInst withVariable(Variable var)
var
- additional Variable.java.lang.NullPointerException
- if var is nullpublic ImmutableNodeInst withoutVariable(Variable.Key key)
key
- Variable Key to remove.java.lang.NullPointerException
- if key is nullpublic boolean isEasyShape()
public ImmutableNodeInst withPortInst(PortProtoId portProtoId, ImmutablePortInst portInst)
portProtoId
- PortProtoId of port instance.java.lang.NullPointerException
- if var is nullpublic boolean isUsernamed()
public ImmutablePortInst getPortInst(PortProtoId portProtoId)
portProtoId
- PortProtoId of port instance.java.lang.NullPointerException
- if portProtoId is null.IlleagalArgumentException
- if parent of portProtoId is not protoId of this ImmutableNodeInst.public java.util.Iterator<PortProtoId> getPortsWithVariables()
java.lang.NullPointerException
- if portProtoId is null.IlleagalArgumentException
- if parent of portProtoId is not protoId of this ImmutableNodeInst.public boolean hasPortInstVariables()
public boolean is(ImmutableNodeInst.Flag flag)
flag
- flag selector.public int hashCodeExceptVariables()
hashCodeExceptVariables
in class ImmutableElectricObject
public boolean equalsExceptVariables(ImmutableElectricObject o)
equalsExceptVariables
in class ImmutableElectricObject
o
- other ImmutableElectricObject.public void check()
java.lang.AssertionError
- if invariant is broken.public static boolean isCellCenter(NodeProtoId protoId)
public int getElibBits()
public static int flagsFromElib(int elibBits)
elibBits
- ELIB user bits.public static int techSpecificFromElib(int elibBits)
elibBits
- ELIB user bits.public void computeBounds(NodeInst real, java.awt.geom.Rectangle2D.Double dstBounds)
public EPoint[] getTrace()
public double[] getArcDegrees()
public double getSerpentineTransistorLength()