View Javadoc

1   package net.sf.tomp.xtcl.command;
2   
3   import net.sf.tomp.xtcl.Context;
4   
5   import java.io.PrintStream;
6   
7   /***
8    * DOCUMENT ME!
9    * 
10   * @author tomp
11   */
12  public class Err extends AbstractCommand {
13      /*** DOCUMENT ME! */
14      protected int err;
15  
16      /***
17       * DOCUMENT ME!
18       * 
19       * @param r DOCUMENT ME!
20       */
21      public void setError(int r) {
22          err = r;
23      }
24  
25      /***
26       * DOCUMENT ME!
27       * 
28       * @param context DOCUMENT ME!
29       * @return DOCUMENT ME!
30       */
31      public int execute(Context context) {
32          PrintStream out = context.getOut();
33  
34          if (out != null) {
35              out.print("ERR " + this);
36          }
37  
38          return err;
39      }
40  
41      /***
42       * DOCUMENT ME!
43       * 
44       * @return DOCUMENT ME!
45       */
46      public String toString() {
47          return "CODE=" + err;
48      }
49  }
50  
51  /*
52   * The contents of this file are subject to the Mozilla Public License Version
53   * 1.1 (the "License"); you may not use this file except in compliance with the
54   * License. You may obtain a copy of the License at http://www.mozilla.org/MPL/
55   * Software distributed under the License is distributed on an "AS IS" basis,
56   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
57   * the specific language governing rights and limitations under the License. The
58   * Original Code is: all this file. The Initial Developer of the Original Code
59   * is: Tomas Pitner, Masaryk University in Brno, Czech Republic. Contributor(s):
60   */