Interface World<W extends World<W>>

Type Parameters:
W - The concrete World type
All Known Subinterfaces:
Value<W,​V>
All Known Implementing Classes:
SimpleWorld, Value.ValueImpl

public interface World<W extends World<W>>

A World is a 'memory' for (old) Objects and the entry point for sending Messages to Objects.

But specific Worlds can do much more than that. They could:

  • Log all Messages sent
  • Capture the history of Object states
  • Synchronize state between concurrent Worlds
  • Capture runtime dependencies between Object states and Messages
  • etc, etc

See SimpleWorld for an example implementation.

  • Method Summary

    Modifier and Type Method Description
    W init()
    Returns a pristine new World of type W
    <O> Value<W,​O> obj​(Id<? extends O> id)
    Returns the current Object O value, given an id.
    <O> Value<W,​O> old​(Id<? extends O> id)
    Returns the old Object O value, given an id.
    <I extends Id<O>,​ O,​ E>
    Value<W,​E>
    send​(I id, Message<I,​O,​E> msg)
    Returns the effect Value E, after sending a Message to Object O, given an Object identifier.
  • Method Details

    • obj

      <O> Value<W,​O> obj​(Id<? extends O> id)
      Returns the current Object O value, given an id.
      Type Parameters:
      O - the Object type
      Parameters:
      id - the Object Id
      Returns:
      the current Object O, wrapped in a Value
    • old

      <O> Value<W,​O> old​(Id<? extends O> id)
      Returns the old Object O value, given an id.
      Type Parameters:
      O - the Object type
      Parameters:
      id - the Object Id
      Returns:
      the current Object O, wrapped in a Value
    • send

      <I extends Id<O>,​ O,​ E> Value<W,​E> send​(I id, Message<I,​O,​E> msg)
      Returns the effect Value E, after sending a Message to Object O, given an Object identifier.
      Type Parameters:
      I - the Id Type
      O - the Object Type
      E - the Effect Type
      Parameters:
      id - the Object identifier to send the Message to
      msg - the message to send to the Object
      Returns:
      the effect of the Message send, wrapped in a Value
    • init

      W init()
      Returns a pristine new World of type W
      Returns:
      a pristine new World