Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/dinopolis/util/debug/DebugMessageFormatObject.java


1   /***********************************************************************
2    * @(#)$RCSfile: DebugMessageFormatObject.java,v $   $Revision: 1.1.1.1 $ $Date: 2003/01/10 15:33:38 $
3    *
4    * Copyright (c) 2000 IICM, Graz University of Technology
5    * Inffeldgasse 16c, A-8010 Graz, Austria.
6    * 
7    * This program is free software; you can redistribute it and/or modify
8    * it under the terms of the GNU Lesser General Public License (LGPL)
9    * as published by the Free Software Foundation; either version 2.1 of
10   * the License, or (at your option) any later version.
11   * 
12   * This program is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   * GNU Lesser General Public License for more details.
16   * 
17   * You should have received a copy of the GNU Lesser General Public 
18   * License along with this program; if not, write to the
19   * Free Software Foundation, Inc., 
20   * 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
21   ***********************************************************************/
22  
23  
24  package org.dinopolis.util.debug;
25  
26  //______________________________________________________________________
27  //______________________________________________________________________
28  /**
29   * This class is the baseclass for all objects responsible for the
30   * formatting of the Debug message.
31   *
32   * As these objects are created by a factory, all subclasses must be
33   * named "DebugMessageFORMATSTRING" (formatstring in uppercase).
34   *   
35  */
36  public abstract class DebugMessageFormatObject
37  {
38  //  protected Debug debug_ = null;
39  
40  
41  //______________________________________________________________________
42  /**
43   * Empty default constructor (all subclasses are created by a factory).
44   */
45    public DebugMessageFormatObject()
46    {
47    }
48  
49  //  //______________________________________________________________________
50  //  /**
51  //   * This is the method to override on subclasses. It is called whenever
52  //   * the an evaluation of the token in the format string of the debug
53  //   * messages is needed.
54  //   *
55  //   *
56  //   * @param debug the debug object this message string belongs to. It
57  //   * can be used in the <code>getMessage</code>-method to retrieve
58  //   * additional information about what should be returned exactly
59  //   */
60  //    public void setDebug(Debug debug)
61  //    {
62  //      debug_ = debug;
63  //    }
64  
65  //______________________________________________________________________
66  /**
67   * This is the method to override on subclasses. It is called whenever
68   * an evaluation of the keyword in the format string of the debug
69   * messages is needed. The given arguments can be used by the subclass:
70   * e.g. the subclass DebugMessageLETTERCOUNT might return here the
71   * number of letters in the debug message (as a String). Other classes
72   * may ignore all arguments: e.g. DebugMessageDATE returns the
73   * current date/time, no matter what debug message/level is
74   * given. Other subclasses again might need the Debug-instance to
75   * obtain special information stored there:
76   * DebugMessageDIFFMILLISECONDS needs the time the last debug message
77   * was printed. This information can be retrieved from the Debug
78   * instance. 
79   *
80   * @param level the debug level for the given debug message.
81   * @param debug_message the debug message to be printed.
82   * @param debug_instance the debug object this message string belongs
83   * to. It can be used in the <code>getMessage</code>-method to
84   * retrieve additional information about what should be returned
85   * exactly.
86   */
87    public abstract String getEvaluatedKeyword(String level,
88                                               String debug_message,
89                                               Debug debug_instance);
90  }
91  
92  
93