com.almende.eve.state
Class ConcurrentFileState

java.lang.Object
  extended by com.almende.eve.state.AbstractState
      extended by com.almende.eve.state.FileState
          extended by com.almende.eve.state.ConcurrentFileState
All Implemented Interfaces:
State, Map<String,Object>

public class ConcurrentFileState
extends FileState

Author:
jos, ludo

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class com.almende.eve.state.AbstractState
agentId
 
Fields inherited from interface com.almende.eve.state.State
KEY_AGENT_TYPE
 
Constructor Summary
protected ConcurrentFileState()
           
  ConcurrentFileState(String agentId, String filename)
           
 
Method Summary
 void clear()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 void destroy()
          destroy is executed once after the agent method is invoked if the properties are changed, they will be saved
 Set<Map.Entry<String,Object>> entrySet()
           
 Object get(Object key)
           
 void init()
          init is executed once before the agent method is invoked
 boolean isEmpty()
           
 Set<String> keySet()
           
 Object put(String key, Object value)
           
 void putAll(Map<? extends String,? extends Object> map)
           
 boolean putIfUnchanged(String key, Object newVal, Object oldVal)
           
 Object remove(Object key)
           
 int size()
           
 Collection<Object> values()
           
 
Methods inherited from class com.almende.eve.state.AbstractState
getAgentId, getAgentType, setAgentType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

ConcurrentFileState

protected ConcurrentFileState()

ConcurrentFileState

public ConcurrentFileState(String agentId,
                           String filename)
Method Detail

init

public void init()
init is executed once before the agent method is invoked

Specified by:
init in interface State
Specified by:
init in class FileState

destroy

public void destroy()
destroy is executed once after the agent method is invoked if the properties are changed, they will be saved

Specified by:
destroy in interface State
Specified by:
destroy in class FileState

clear

public void clear()
Specified by:
clear in interface Map<String,Object>
Specified by:
clear in class FileState

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map<String,Object>
Specified by:
keySet in class FileState

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,Object>
Specified by:
containsKey in class FileState

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<String,Object>
Specified by:
containsValue in class FileState

entrySet

public Set<Map.Entry<String,Object>> entrySet()
Specified by:
entrySet in interface Map<String,Object>
Specified by:
entrySet in class FileState

get

public Object get(Object key)
Specified by:
get in interface Map<String,Object>
Specified by:
get in class FileState

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<String,Object>
Specified by:
isEmpty in class FileState

put

public Object put(String key,
                  Object value)
Specified by:
put in interface Map<String,Object>
Specified by:
put in class FileState

putAll

public void putAll(Map<? extends String,? extends Object> map)
Specified by:
putAll in interface Map<String,Object>
Specified by:
putAll in class FileState

putIfUnchanged

public boolean putIfUnchanged(String key,
                              Object newVal,
                              Object oldVal)

remove

public Object remove(Object key)
Specified by:
remove in interface Map<String,Object>
Specified by:
remove in class FileState

size

public int size()
Specified by:
size in interface Map<String,Object>
Specified by:
size in class FileState

values

public Collection<Object> values()
Specified by:
values in interface Map<String,Object>
Specified by:
values in class FileState


Copyright © 2013 Almende BV. All Rights Reserved.