Package org.jmanikin.world
Class SimpleWorld
java.lang.Object
org.jmanikin.world.SimpleWorld
- All Implemented Interfaces:
World<SimpleWorld>
public class SimpleWorld extends java.lang.Object implements World<SimpleWorld>
A SimpleWorld provides a (mutable!) World implementation that still conforms to Manikin's minimum semantics.
Because SimpleWorld is not immutable you cannot share it between multiple Threads.
WARNING: NOT THREAD SAFE
-
Constructor Summary
Constructors Constructor Description SimpleWorld() -
Method Summary
Modifier and Type Method Description SimpleWorldinit()Returns a pristine new World of type W<O> Value<SimpleWorld,O>obj(Id<? extends O> id)Returns the current Object O value, given an id.<O> Value<SimpleWorld,O>old(Id<? extends O> id)Returns the old Object O value, given an id.<I extends Id<O>, O, E>
Value<SimpleWorld,E>send(I id, Message<I,O,E> message)Returns the effect Value E, after sending a Message to Object O, given an Object identifier.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
SimpleWorld
public SimpleWorld()
-
-
Method Details
-
obj
Description copied from interface:WorldReturns the current Object O value, given an id.- Specified by:
objin interfaceWorld<SimpleWorld>- Type Parameters:
O- the Object type- Parameters:
id- the Object Id- Returns:
- the current Object O, wrapped in a Value
-
old
Description copied from interface:WorldReturns the old Object O value, given an id.- Specified by:
oldin interfaceWorld<SimpleWorld>- Type Parameters:
O- the Object type- Parameters:
id- the Object Id- Returns:
- the current Object O, wrapped in a Value
-
send
Description copied from interface:WorldReturns the effect Value E, after sending a Message to Object O, given an Object identifier.- Specified by:
sendin interfaceWorld<SimpleWorld>- Type Parameters:
I- the Id TypeO- the Object TypeE- the Effect Type- Parameters:
id- the Object identifier to send the Message tomessage- the message to send to the Object- Returns:
- the effect of the Message send, wrapped in a Value
-
init
Description copied from interface:WorldReturns a pristine new World of type W- Specified by:
initin interfaceWorld<SimpleWorld>- Returns:
- a pristine new World
-