org.sandev.tools.ConfigEditor
Class ConfigDataCache

java.lang.Object
  extended byorg.sandev.tools.ConfigEditor.ConfigDataCache
All Implemented Interfaces:
org.sandev.basics.util.IDCache

public class ConfigDataCache
extends java.lang.Object
implements org.sandev.basics.util.IDCache

An extremely simple mechanism to return any persistent object within a Configuration via its ID. This makes no attempt at being super efficient since the number of elements in the initialData is presumed to be relatively small.

There is no messaging going on here, this is just for lookup.


Field Summary
protected  org.sandev.basics.sandmessages.Configuration config
           
 
Constructor Summary
ConfigDataCache(org.sandev.basics.sandmessages.Configuration config)
           
 
Method Summary
 void clear()
          does nothing
 org.sandev.basics.sandmessages.Configuration getConfig()
          accessor for config
 org.sandev.basics.structs.SandPersistMessage getInstance(long id)
           
 java.util.Map getMap()
          ConfigDataCache is not Map-based; returns null
 boolean putInstance(org.sandev.basics.structs.SandPersistMessage msg)
          This cache does not actually accept any new instances for caching, it is initialized with a Configuration instead.
 org.sandev.basics.structs.SandPersistMessage removeInstance(long id)
          This cache does not actually remove any instances from caching, the Configuration is not affected.
 void setConfig(org.sandev.basics.sandmessages.Configuration config)
          mutator for config
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected org.sandev.basics.sandmessages.Configuration config
Constructor Detail

ConfigDataCache

public ConfigDataCache(org.sandev.basics.sandmessages.Configuration config)
Method Detail

getConfig

public org.sandev.basics.sandmessages.Configuration getConfig()
accessor for config


setConfig

public void setConfig(org.sandev.basics.sandmessages.Configuration config)
mutator for config


putInstance

public boolean putInstance(org.sandev.basics.structs.SandPersistMessage msg)
This cache does not actually accept any new instances for caching, it is initialized with a Configuration instead.

Specified by:
putInstance in interface org.sandev.basics.util.IDCache

getInstance

public org.sandev.basics.structs.SandPersistMessage getInstance(long id)
Specified by:
getInstance in interface org.sandev.basics.util.IDCache

removeInstance

public org.sandev.basics.structs.SandPersistMessage removeInstance(long id)
This cache does not actually remove any instances from caching, the Configuration is not affected.

Specified by:
removeInstance in interface org.sandev.basics.util.IDCache

clear

public void clear()
does nothing

Specified by:
clear in interface org.sandev.basics.util.IDCache

getMap

public java.util.Map getMap()
ConfigDataCache is not Map-based; returns null

Specified by:
getMap in interface org.sandev.basics.util.IDCache