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(java.util.Collection<Technology> technologies)
          Constructs TechPool from Collection of technologies All technologies must belong to the same IdManager
TechPool(IdManager idManager)
          Constructs empty TechPool
 
Method Summary
 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)
           
 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 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
 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 getTech(TechId techId)
          Get Technology by TechId TechId must belong to same IdManager as TechPool
static TechPool read(IdReader reader)
          Reads TechPool from IdReader
 TechPool withTech(Technology tech)
          Returns new TechPool which differs from this TechPool by adding new technology
 void write(IdWriter writer)
          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

TechPool

public TechPool(java.util.Collection<Technology> technologies)
Constructs TechPool from Collection of technologies All technologies must belong to the same IdManager

Parameters:
technologies - Collection of technologies in the Pool
Method Detail

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

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>

write

public void write(IdWriter writer)
           throws java.io.IOException
Writes this TechPool to IdWriter

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

read

public static TechPool read(IdReader reader)
                     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