com.sun.electric.database
Class ImmutableCell

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

public class ImmutableCell
extends ImmutableElectricObject

Immutable class ImmutableCell represents a cell.


Field Summary
 CellId cellId
          CellId of this ImmutableCell.
 long creationDate
          The date this ImmutableCell was created.
 CellName groupName
          The group name of this ImmutableCell.
 long revisionDate
          The date this ImmutableCell was modified.
 TechId techId
          This ImmutableCell's TechId.
 
Fields inherited from class com.sun.electric.database.ImmutableElectricObject
flags
 
Method Summary
 boolean busNamesAllowed()
          Method to return true if bus names are allowed in this Cell
 void check()
          Checks invariant of this ImmutableCell.
 boolean equalsExceptVariables(ImmutableElectricObject o)
          Indicates whether fields of other ImmutableElectricObject are equal to fileds of this object.
 LibId getLibId()
          Returns LibId of the Library to which this ImmutableCell belongs.
 int getNumParameters()
          Method to return the number of Parameters on this ImmutableCell.
 Variable getParameter(int paramIndex)
          Method to return the Parameter by its paramIndex.
 Variable getParameter(Variable.AttrKey key)
          Method to return the Parameter on this ImmuatbleCell with a given key.
 java.util.Iterator<Variable> getParameters()
          Method to return an Iterator over all Parameters on this ImmutableCell.
 int hashCodeExceptVariables()
          Return a hash code value for fields of this object.
static ImmutableCell newInstance(CellId cellId, long creationDate)
          Returns new ImmutableCell object.
 boolean paramsAllowed()
          Tells if parameters are allowed on this ImmutableCell.
 java.lang.String toString()
           
 ImmutableCell withCreationDate(long creationDate)
          Returns ImmutableCell which differs from this ImmutableCell by creation date.
 ImmutableCell withFlags(int flags)
          Returns ImmutableCell which differs from this ImmutableCell by flags.
 ImmutableCell withGroupName(CellName groupName)
          Returns ImmutableCell which differs from this ImmutableCell by group name.
 ImmutableCell withoutParam(Variable.AttrKey key)
          Returns ImmutableCell which differs from this ImmutableCell by removing parameter with the specified key.
 ImmutableCell withoutVariable(Variable.Key key)
          Returns ImmutableCell which differs from this ImmutableCell by removing Variable with the specified key.
 ImmutableCell withoutVariables()
          Returns ImmutableCell which differs from this ImmutableCell by removing all Variables.
 ImmutableCell withParam(Variable var)
          Returns ImmutableCell which differs from this ImmutableCell by additional parameter.
 ImmutableCell withRevisionDate(long revisionDate)
          Returns ImmutableCell which differs from this ImmutableCell by revision date.
 ImmutableCell withTechId(TechId techId)
          Returns ImmutableCell which differs from this ImmutableCell by technology.
 ImmutableCell withVariable(Variable var)
          Returns ImmutableCell which differs from this ImmutableCell 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, wait, wait, wait
 

Field Detail

cellId

public final CellId cellId
CellId of this ImmutableCell.


groupName

public final CellName groupName
The group name of this ImmutableCell.


creationDate

public final long creationDate
The date this ImmutableCell was created.


revisionDate

public final long revisionDate
The date this ImmutableCell was modified.


techId

public final TechId techId
This ImmutableCell's TechId.

Method Detail

newInstance

public static ImmutableCell newInstance(CellId cellId,
                                        long creationDate)
Returns new ImmutableCell object.

Parameters:
cellId - id of this ImmutableCell.
creationDate - creation date of this ImmutableCell.
Returns:
new ImmutableCell object.
Throws:
java.lang.NullPointerException - if cellId or libId is null.

withGroupName

public ImmutableCell withGroupName(CellName groupName)
Returns ImmutableCell which differs from this ImmutableCell by group name.

Parameters:
groupName - new group name.
Returns:
ImmutableCell which differs from this ImmutableCell by cell name.
Throws:
java.lang.IllegalArgumentException - if groupName is not schematic view and zero version.

withCreationDate

public ImmutableCell withCreationDate(long creationDate)
Returns ImmutableCell which differs from this ImmutableCell by creation date.

Parameters:
creationDate - new creation date.
Returns:
ImmutableCell which differs from this ImmutableCell by creation date.

withRevisionDate

public ImmutableCell withRevisionDate(long revisionDate)
Returns ImmutableCell which differs from this ImmutableCell by revision date.

Parameters:
revisionDate - new revision date.
Returns:
ImmutableCell which differs from this ImmutableCell by revision date.

withTechId

public ImmutableCell withTechId(TechId techId)
Returns ImmutableCell which differs from this ImmutableCell by technology.

Parameters:
techId - new technology Id.
Returns:
ImmutableCell which differs from this ImmutableCell by technology.

withFlags

public ImmutableCell withFlags(int flags)
Returns ImmutableCell which differs from this ImmutableCell by flags.

Parameters:
flags - new flags.
Returns:
ImmutableCell which differs from this ImmutableCell by flags.

getParameter

public Variable getParameter(Variable.AttrKey key)
Method to return the Parameter on this ImmuatbleCell with a given key.

Parameters:
key - the key of the Variable.
Returns:
the Parameter with that key, or null if there is no such Variable.
Throws:
java.lang.NullPointerException - if key is null

getParameters

public java.util.Iterator<Variable> getParameters()
Method to return an Iterator over all Parameters on this ImmutableCell.

Returns:
an Iterator over all Parameters on this ImmutableCell.

getNumParameters

public int getNumParameters()
Method to return the number of Parameters on this ImmutableCell.

Returns:
the number of Parametes on this ImmutableCell.

getParameter

public Variable getParameter(int paramIndex)
Method to return the Parameter by its paramIndex.

Parameters:
paramIndex - index of Parameter.
Returns:
the Parameter with given paramIndex.
Throws:
ArrayIndexOutOfBoundesException - if paramIndex out of bounds.

withParam

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

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

withoutParam

public ImmutableCell withoutParam(Variable.AttrKey key)
Returns ImmutableCell which differs from this ImmutableCell by removing parameter with the specified key. Returns this ImmutableCell if it doesn't contain parameter with the specified key.

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

withVariable

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

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

withoutVariable

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

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

withoutVariables

public ImmutableCell withoutVariables()
Returns ImmutableCell which differs from this ImmutableCell by removing all Variables. Returns this ImmutableCell if it hasn't variables.

Returns:
ImmutableCell without Variables.

getLibId

public LibId getLibId()
Returns LibId of the Library to which this ImmutableCell belongs.


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 ImmutableCell.

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

paramsAllowed

public boolean paramsAllowed()
Tells if parameters are allowed on this ImmutableCell. Currently parameters are allowed only on icon and scheamtic cells.

Returns:
true if parameters are allowed on this ImmutableCell

busNamesAllowed

public boolean busNamesAllowed()
Method to return true if bus names are allowed in this Cell

Returns:
true if bus names are allowed in this Cell

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object