com.sun.electric.database
Class ImmutablePortInst

java.lang.Object
  extended by com.sun.electric.database.ImmutableElectricObject
      extended by com.sun.electric.database.ImmutablePortInst

public class ImmutablePortInst
extends ImmutableElectricObject

Immutable class which stores varaibles of PortInst.


Field Summary
static ImmutablePortInst EMPTY
           
static ImmutablePortInst[] NULL_ARRAY
           
 
Fields inherited from class com.sun.electric.database.ImmutableElectricObject
flags
 
Method Summary
 void check()
          Checks invariant of this ImmutablePortInst.
 boolean equalsExceptVariables(ImmutableElectricObject o)
          Indicates whether fields of other ImmutableElectricObject are equal to fileds of this object.
 int hashCodeExceptVariables()
          Return a hash code value for fields of this object.
 ImmutablePortInst withoutVariable(Variable.Key key)
          Returns ImmutablePortInst which differs from this ImmutablePortInst by removing Variable with the specified key.
 ImmutablePortInst withRenamedIds(IdMapper idMapper)
          Returns ImmutablePortInst which differs from this ImmutablePortInst by renamed Ids.
 ImmutablePortInst withVariable(Variable var)
          Returns ImmutablePortInst which differs from this ImmutablePortInst by additional Variable.
 
Methods inherited from class com.sun.electric.database.ImmutableElectricObject
getNumVariables, getVar, getVar, getVariables, getVarValue, searchVar, toVariableArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_ARRAY

public static final ImmutablePortInst[] NULL_ARRAY

EMPTY

public static final ImmutablePortInst EMPTY
Method Detail

withVariable

public ImmutablePortInst withVariable(Variable var)
Returns ImmutablePortInst which differs from this ImmutablePortInst by additional Variable. If this ImmutablePortInst has Variable with the same key as new, the old Variable will not be in new ImmutablePortInst.

Parameters:
var - additional Variable.
Returns:
ImmutablePortInst with additional Variable.
Throws:
java.lang.NullPointerException - if var is null

withoutVariable

public ImmutablePortInst withoutVariable(Variable.Key key)
Returns ImmutablePortInst which differs from this ImmutablePortInst by removing Variable with the specified key. Returns this ImmutablePortInst if it doesn't contain variable with the specified key.

Parameters:
key - Variable Key to remove.
Returns:
ImmutablePortInst without Variable with the specified key.
Throws:
java.lang.NullPointerException - if key is null

withRenamedIds

public ImmutablePortInst withRenamedIds(IdMapper idMapper)
Returns ImmutablePortInst which differs from this ImmutablePortInst by renamed Ids.

Parameters:
idMapper - a map from old Ids to new Ids.
Returns:
ImmutablePortInst with renamed Ids.

hashCodeExceptVariables

public int hashCodeExceptVariables()
Return a hash code value for fields of this object. Variables of objects are not compared

Specified by:
hashCodeExceptVariables in class ImmutableElectricObject

equalsExceptVariables

public boolean equalsExceptVariables(ImmutableElectricObject o)
Indicates whether fields of other ImmutableElectricObject are equal to fileds of this object. Variables of objects are not compared.

Specified by:
equalsExceptVariables in class ImmutableElectricObject
Parameters:
o - other ImmutableElectricObject.
Returns:
true if fields of objects are equal.

check

public void check()
Checks invariant of this ImmutablePortInst.

Throws:
java.lang.AssertionError - if invariant is broken.