com.sun.electric.technology
Class TechPool

java.lang.Object
  extended by java.util.AbstractMap<TechId,Technology>
      extended by com.sun.electric.technology.TechPool
All Implemented Interfaces:
java.util.Map<TechId,Technology>

public class TechPool
extends java.util.AbstractMap<TechId,Technology>

A customized Map from TechId to Technolgy. All TechIds must belong to same IdManager.


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
 IdManager idManager
           
 
Constructor Summary
TechPool(IdManager idManager)
          Constructs empty TechPool
 
Method Summary
 void activate()
           
 void check()
          Checks invariants in this TechPool.
 boolean containsKey(java.lang.Object key)
           
 boolean containsValue(java.lang.Object value)
           
 void correctSizesToDisk(java.util.List<CellRevision> cells, Version version, java.util.Map<Setting,java.lang.Object> projectSettings, boolean isJelib, boolean keepExtendOverMin)
           
 TechPool deepClone()
           
 java.util.Set<java.util.Map.Entry<TechId,Technology>> entrySet()
           
 boolean equals(java.lang.Object o)
           
 boolean equals(TechPool that)
          Tests that two TechPools contains the same set of Tehnologies
 Technology findTechnology(java.lang.String techName)
          Find Technology by its name
 Technology get(java.lang.Object key)
           
 ArcProto getArcProto(ArcProtoId arcProtoId)
          Get ArcProto by ArcProtoId ArcProtoId must belong to same IdManager as TechPool
 Artwork getArtwork()
          Returns Artwork technology in this database
 Generic getGeneric()
          Returns Generic technology in this database
 Layer getLayer(LayerId layerId)
          Get Layer by LayerId LayerId must belong to same IdManager as TechPool
 PrimitiveNode getPrimitiveNode(PrimitiveNodeId primitiveNodeId)
          Get PrimitiveNode by PrimitiveNodeId PrimitiveNodeId must belong to same IdManager as TechPool
 PrimitivePort getPrimitivePort(PrimitivePortId primitivePortId)
          Get PrimitivePort by PrimitivePortId PrimitivePortId must belong to same IdManager as TechPool
 Schematics getSchematics()
          Returns Schematic technology in this database
 Technology.State getState(TechId techId)
          Get Technology.State by TechId TechId must belong to same IdManager as TechPool
 Technology getTech(TechId techId)
          Get Technology by TechId TechId must belong to same IdManager as TechPool
 java.util.Map<TechFactory.Param,java.lang.Object> getTechParams()
           
static TechPool getThreadTechPool()
          Returns thread-local TechPool
 boolean isActive()
           
static TechPool read(IdReader reader, TechPool old)
          Reads TechPool from IdReader
 TechPool restrict(java.util.BitSet techUsed)
          Returns restriction of this TechPool to specified subset of TechIds
 TechPool restrict(java.util.BitSet techUsed, TechPool candidatePool)
          Returns restriction of this TechPool to specified subset of TechIds.
 TechPool withTech(Technology tech)
          Returns new TechPool which differs from this TechPool by adding new technology
 TechPool withTechParams(java.util.Map<TechFactory.Param,java.lang.Object> paramValues)
           
 void writeDiff(IdWriter writer, TechPool old)
          Writes this TechPool to IdWriter
 
Methods inherited from class java.util.AbstractMap
clear, clone, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

idManager

public final IdManager idManager
Constructor Detail

TechPool

public TechPool(IdManager idManager)
Constructs empty TechPool

Parameters:
idManager - pool's IdManager
Method Detail

getTechParams

public java.util.Map<TechFactory.Param,java.lang.Object> getTechParams()

withTechParams

public TechPool withTechParams(java.util.Map<TechFactory.Param,java.lang.Object> paramValues)

activate

public void activate()

isActive

public boolean isActive()

deepClone

public TechPool deepClone()

restrict

public TechPool restrict(java.util.BitSet techUsed,
                         TechPool candidatePool)
Returns restriction of this TechPool to specified subset of TechIds. A candidate TechPool is a valid result, it is returned to save allocation.

Parameters:
techUsed - contains techIndex of those TechIds which are in subset
candidatePool - a candidate TechPool to save allocation
Returns:
restriction of this TechPool to specified subset of TechIds

restrict

public TechPool restrict(java.util.BitSet techUsed)
Returns restriction of this TechPool to specified subset of TechIds

Parameters:
techUsed - contains techIndex of those TechIds which are in subset
Returns:
restriction of this TechPool to specified subset of TechIds

withTech

public TechPool withTech(Technology tech)
Returns new TechPool which differs from this TechPool by adding new technology

Parameters:
tech - Technology to add
Returns:
TechPool which differs from this TechPool by adding technology

getTech

public Technology getTech(TechId techId)
Get Technology by TechId TechId must belong to same IdManager as TechPool

Parameters:
techId - TechId to find
Returns:
Technology by given TechId or null
Throws:
java.lang.IllegalArgumentException - if TechId is not from this IdManager

findTechnology

public Technology findTechnology(java.lang.String techName)
Find Technology by its name

Parameters:
techName - name of technology
Returns:
Technology by given name or null

getState

public Technology.State getState(TechId techId)
Get Technology.State by TechId TechId must belong to same IdManager as TechPool

Parameters:
techId - TechId to find
Returns:
Technology by given TechId or null
Throws:
java.lang.IllegalArgumentException - if TechId is not from this IdManager

getLayer

public Layer getLayer(LayerId layerId)
Get Layer by LayerId LayerId must belong to same IdManager as TechPool

Parameters:
layerId - LayerId to find
Returns:
Layer by given LayerId or null
Throws:
java.lang.IllegalArgumentException - if TechId is not from this IdManager

getArcProto

public ArcProto getArcProto(ArcProtoId arcProtoId)
Get ArcProto by ArcProtoId ArcProtoId must belong to same IdManager as TechPool

Parameters:
arcProtoId - ArcProtoId to find
Returns:
ArcProto by given ArcProtoId or null
Throws:
java.lang.IllegalArgumentException - if TechId is not from this IdManager

getPrimitiveNode

public PrimitiveNode getPrimitiveNode(PrimitiveNodeId primitiveNodeId)
Get PrimitiveNode by PrimitiveNodeId PrimitiveNodeId must belong to same IdManager as TechPool

Parameters:
primitiveNodeId - PrimitiveNodeId to find
Returns:
PrimitiveNode by given PrimitiveNodeId or null
Throws:
java.lang.IllegalArgumentException - if TechId is not from this IdManager

getPrimitivePort

public PrimitivePort getPrimitivePort(PrimitivePortId primitivePortId)
Get PrimitivePort by PrimitivePortId PrimitivePortId must belong to same IdManager as TechPool

Parameters:
primitivePortId - PrimitivePortId to find
Returns:
PrimitivePort by given PrimitivePortId or null
Throws:
java.lang.IllegalArgumentException - if TechId is not from this IdManager

correctSizesToDisk

public void correctSizesToDisk(java.util.List<CellRevision> cells,
                               Version version,
                               java.util.Map<Setting,java.lang.Object> projectSettings,
                               boolean isJelib,
                               boolean keepExtendOverMin)

getArtwork

public Artwork getArtwork()
Returns Artwork technology in this database


getGeneric

public Generic getGeneric()
Returns Generic technology in this database


getSchematics

public Schematics getSchematics()
Returns Schematic technology in this database


equals

public boolean equals(TechPool that)
Tests that two TechPools contains the same set of Tehnologies

Parameters:
that - second TechPool
Returns:
true if this and that TechPools are equal

containsKey

public boolean containsKey(java.lang.Object key)
Specified by:
containsKey in interface java.util.Map<TechId,Technology>
Overrides:
containsKey in class java.util.AbstractMap<TechId,Technology>

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface java.util.Map<TechId,Technology>
Overrides:
containsValue in class java.util.AbstractMap<TechId,Technology>

get

public Technology get(java.lang.Object key)
Specified by:
get in interface java.util.Map<TechId,Technology>
Overrides:
get in class java.util.AbstractMap<TechId,Technology>

entrySet

public java.util.Set<java.util.Map.Entry<TechId,Technology>> entrySet()
Specified by:
entrySet in interface java.util.Map<TechId,Technology>
Specified by:
entrySet in class java.util.AbstractMap<TechId,Technology>

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Map<TechId,Technology>
Overrides:
equals in class java.util.AbstractMap<TechId,Technology>

writeDiff

public void writeDiff(IdWriter writer,
                      TechPool old)
               throws java.io.IOException
Writes this TechPool to IdWriter

Parameters:
writer - IdWriter
Throws:
java.io.IOException

read

public static TechPool read(IdReader reader,
                            TechPool old)
                     throws java.io.IOException
Reads TechPool from IdReader

Parameters:
reader - IdReader
Returns:
TechPool read
Throws:
java.io.IOException

check

public void check()
Checks invariants in this TechPool.

Throws:
java.lang.AssertionError - if invariants are not valid

getThreadTechPool

public static TechPool getThreadTechPool()
Returns thread-local TechPool

Returns:
thread-local TechPool