com.sun.electric.database
Class ImmutableLibrary

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

public class ImmutableLibrary
extends ImmutableElectricObject

Immutable class ImmutableLibrary represents a library.


Field Summary
 java.net.URL libFile
          file location of this ImmutableLibrary
 LibId libId
          LibId of this ImmutableLibrary.
 Version version
          version of Electric which wrote the ImmutableLibrary.
 
Fields inherited from class com.sun.electric.database.ImmutableElectricObject
flags
 
Method Summary
 void check()
          Checks invariant of this ImmutableCell.
 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.
static ImmutableLibrary newInstance(LibId libId, java.net.URL libFile, Version version)
          Returns new ImmutableLibrary object.
 java.lang.String toString()
          Returns a printable version of this ImmutableLibrary.
 ImmutableLibrary withFlags(int flags)
          Returns ImmutableLibrary which differs from this ImmutableLibrary by flags.
 ImmutableLibrary withLibFile(java.net.URL libFile)
          Returns ImmutableLibrary which differs from this ImmutableLibrary by file.
 ImmutableLibrary withoutVariable(Variable.Key key)
          Returns ImmutableCell which differs from this ImmutableCell by removing Variable with the specified key.
 ImmutableLibrary withVariable(Variable var)
          Returns ImmutableLibrary which differs from this ImmutableLibrary by additional Variable.
 ImmutableLibrary withVersion(Version version)
          Returns ImmutableLibrary which differs from this ImmutableLibrary by version.
 
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

libId

public final LibId libId
LibId of this ImmutableLibrary.


libFile

public final java.net.URL libFile
file location of this ImmutableLibrary


version

public final Version version
version of Electric which wrote the ImmutableLibrary.

Method Detail

newInstance

public static ImmutableLibrary newInstance(LibId libId,
                                           java.net.URL libFile,
                                           Version version)
Returns new ImmutableLibrary object.

Parameters:
libId - id of this ImmutableLibrary.
libFile - file location of this ImmutableLibrary.
version - version of Electric which wrote this ImmutableLibrary.
Returns:
new ImmutableLibrary object.
Throws:
java.lang.NullPointerException - if libId is null.

withLibFile

public ImmutableLibrary withLibFile(java.net.URL libFile)
Returns ImmutableLibrary which differs from this ImmutableLibrary by file.

Parameters:
libFile - library file.
Returns:
ImmutableLibrary which differs from this ImmutableLibrary by file.
Throws:
java.lang.NullPointerException - if name is null

withVersion

public ImmutableLibrary withVersion(Version version)
Returns ImmutableLibrary which differs from this ImmutableLibrary by version.

Parameters:
version - version of Electric which wrote this ImmutableLibrary.
Returns:
ImmutableLibrary which differs from this ImmutableExport by version.

withVariable

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

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

withoutVariable

public ImmutableLibrary 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

withFlags

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

Parameters:
flags - new flags.
Returns:
ImmutableLibrary with the specified flags.

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.

toString

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

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

check

public void check()
Checks invariant of this ImmutableCell.

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