com.sun.electric.database
Class Environment

java.lang.Object
  extended by com.sun.electric.database.Environment

public class Environment
extends java.lang.Object

Immutable class to represent Database environment


Field Summary
 java.util.Map<Setting,java.lang.Object> settingValues
           
 TechPool techPool
           
 Setting.RootGroup toolSettings
           
 
Constructor Summary
Environment(IdManager idManager)
           
 
Method Summary
 void activate()
           
 Environment addTech(Technology tech)
           
 void check()
           
 Environment deepClone()
           
 java.util.Map<Setting,java.lang.Object> getSettings()
          Returns map from Setting to its value in this Snapshot
static Environment getThreadEnvironment()
           
 java.lang.Object getValue(Setting setting)
           
 boolean isActive()
           
static Environment readEnvironment(IdReader reader, Environment old)
           
 void saveToPreferences()
           
 void saveToPreferences(java.util.prefs.Preferences prefs)
           
static Environment setThreadEnvironment(Environment environment)
           
 Environment withSettingChanges(Setting.SettingChangeBatch changeBatch)
           
 Environment withToolSettings(Setting.RootGroup toolSettings)
           
 void writeDiff(IdWriter writer, Environment old)
          Writes this Environment to IdWriter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

toolSettings

public final Setting.RootGroup toolSettings

techPool

public final TechPool techPool

settingValues

public final java.util.Map<Setting,java.lang.Object> settingValues
Constructor Detail

Environment

public Environment(IdManager idManager)
Method Detail

getThreadEnvironment

public static Environment getThreadEnvironment()

setThreadEnvironment

public static Environment setThreadEnvironment(Environment environment)

getSettings

public java.util.Map<Setting,java.lang.Object> getSettings()
Returns map from Setting to its value in this Snapshot


getValue

public java.lang.Object getValue(Setting setting)

activate

public void activate()

isActive

public boolean isActive()

withToolSettings

public Environment withToolSettings(Setting.RootGroup toolSettings)

addTech

public Environment addTech(Technology tech)

withSettingChanges

public Environment withSettingChanges(Setting.SettingChangeBatch changeBatch)

deepClone

public Environment deepClone()

saveToPreferences

public void saveToPreferences()

saveToPreferences

public void saveToPreferences(java.util.prefs.Preferences prefs)

writeDiff

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

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

readEnvironment

public static Environment readEnvironment(IdReader reader,
                                          Environment old)
                                   throws java.io.IOException
Throws:
java.io.IOException

check

public void check()