KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > console > Context


1 package org.sapia.console;
2
3
4 /**
5  * Models a command execution context.
6  *
7  * @see CommandConsole#newContext()
8  * @see Command
9  * @author Yanick Duchesne
10  * 29-Nov-02
11  */

12 public class Context {
13   private Console _cons;
14   private CmdLine _cmdLine;
15
16   protected Context() {
17   }
18
19   void setUp(Console cons, CmdLine cmdLine) {
20     _cons = cons;
21     _cmdLine = cmdLine;
22   }
23
24   /**
25    * Returns this context's console.
26    *
27    * @return this context's <code>Console</code>
28    */

29   public Console getConsole() {
30     return _cons;
31   }
32
33   /**
34    * Returns this context's command-line object.
35    *
36    * @return this context's <code>Console</code>
37    */

38   public CmdLine getCommandLine() {
39     return _cmdLine;
40   }
41 }
42
Popular Tags