com.almende.eve.state
Class MemoryStateFactory

java.lang.Object
  extended by com.almende.eve.state.MemoryStateFactory
All Implemented Interfaces:
StateFactory

public class MemoryStateFactory
extends Object
implements StateFactory


Constructor Summary
MemoryStateFactory()
           
MemoryStateFactory(AgentFactory agentFactory, Map<String,Object> params)
          This constructor is called when constructed by the AgentFactory
 
Method Summary
 MemoryState create(String agentId)
          Create a state with given id.
 void delete(String agentId)
          Delete a state.
 boolean exists(String agentId)
          Test if a state with given id exists.
 MemoryState get(String agentId)
          Get state with given id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryStateFactory

public MemoryStateFactory(AgentFactory agentFactory,
                          Map<String,Object> params)
This constructor is called when constructed by the AgentFactory

Parameters:
agentFactory -
params -

MemoryStateFactory

public MemoryStateFactory()
Method Detail

get

public MemoryState get(String agentId)
Get state with given id. Will return null if not found

Specified by:
get in interface StateFactory
Parameters:
agentId -
Returns:
state

create

public MemoryState create(String agentId)
                   throws Exception
Create a state with given id. Will throw an exception when already. existing.

Specified by:
create in interface StateFactory
Parameters:
agentId -
Returns:
state
Throws:
Exception

delete

public void delete(String agentId)
Delete a state. If the state does not exist, nothing will happen.

Specified by:
delete in interface StateFactory
Parameters:
agentId -

exists

public boolean exists(String agentId)
Test if a state with given id exists.

Specified by:
exists in interface StateFactory
Parameters:
agentId -
Returns:
exists


Copyright © 2013 Almende BV. All Rights Reserved.