Package org.jmanikin.core
Interface Environment<I extends Id<O>,O,E>
- Type Parameters:
I- the Id TypeO- the Object TypeE- the Effect Type
- All Superinterfaces:
PreCondition<I,O,E>
- All Known Subinterfaces:
AccountModule.AccountMsg,LocalMessage<I,O,E>,TestModule.LMsg<E>,TransferModule.TransferMsg
- All Known Implementing Classes:
AccountModule.Deposit,AccountModule.Open,AccountModule.Withdraw,LocalMessage.LocalEnvironment,TestModule.LocalCopyId,TestModule.LocalSendSetMember,TestModule.LocalSetMember,TestModule.ThrowPstException,TransferModule.Book
public interface Environment<I extends Id<O>,O,E> extends PreCondition<I,O,E>
An Environment is the self scope that is provided/injected when evaluating a Msg.
All lookups and Messages should be dispatched via this Environment.
-
Method Summary
Modifier and Type Method Description default Oobj()Returns the current Object O<O2> O2obj(Id<? extends O2> id)Returns the current Object O2, given its iddefault Oold()Returns the old Object O<O2> O2old(Id<? extends O2> id)Returns the old Object O2, given its idIself()Returns the Object identifier that's in scope<I2 extends Id<O2>, O2, R2>
R2send(I2 id, Message<I2,O2,R2> msg)Sends a Message to Object O, given an Object identifierMethods inherited from interface org.jmanikin.core.PreCondition
pre
-
Method Details
-
self
I self()Returns the Object identifier that's in scope- Returns:
- the Object identifier
-
obj
Returns the current Object O- Returns:
- the Object O
-
old
Returns the old Object O- Returns:
- the Object O
-
obj
Returns the current Object O2, given its id- Type Parameters:
O2- the Object type- Parameters:
id- the Object identifier- Returns:
- the current Object O2
-
old
Returns the old Object O2, given its id- Type Parameters:
O2- the Object type- Parameters:
id- the Object identifier- Returns:
- the current Object O2
-
send
Sends a Message to Object O, given an Object identifier- Type Parameters:
I2- the Id TypeO2- the Object TypeR2- the Reference Type- Parameters:
id- the Object identifier to send the Message tomsg- the message to send to the Object- Returns:
- the effect R of the Message send
-