Package net.hydromatic.morel.eval
Class Session
java.lang.Object
net.hydromatic.morel.eval.Session
Session environment.
Accessible from EvalEnv.getOpt(String) via the hidden "$session"
variable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceCallback to implement "use" command.private static enumVarious implementations ofSession.Shell. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidhandle(MorelException e, StringBuilder buf) voidvoidwithoutHandlingExceptions(Consumer<Session> consumer) Calls some code with aSession.Shellthat does not handle errors.voidCalls some code with a new value ofSession.Shell.
-
Field Details
-
code
The plan of the previous command. -
out
The output lines of the previous command. -
map
Property values. -
file
File system.Wrapped in a Supplier to avoid the cost of initializing it (scanning a directory) for every session.
-
shell
Implementation of "use".
-
-
Constructor Details
-
Session
Creates a Session.The
mapparameter, that becomes the property map, is used as is, not copied. It may be immutable if the session is for a narrow, internal use. Otherwise, it should probably be aLinkedHashMapto provide deterministic iteration order.- Parameters:
map- Map that contains property values
-
-
Method Details
-
withShell
Calls some code with a new value ofSession.Shell. -
withoutHandlingExceptions
Calls some code with aSession.Shellthat does not handle errors. -
use
-
handle
-