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

Quick Search    Search Deep

Source code: joelib/gui/molviewer/java3d/util/CentralLookup.java


1   ///////////////////////////////////////////////////////////////////////////////
2   //  Filename: $RCSfile: CentralLookup.java,v $
3   //  Purpose:  Counts the number of descriptors and molecules in a molecule file.
4   //  Language: Java
5   //  Compiler: JDK 1.4
6   //  Authors:  Joerg K. Wegner
7   //  Version:  $Revision: 1.2 $
8   //            $Date: 2003/08/19 13:11:26 $
9   //            $Author: wegner $
10  //
11  //  Copyright (c) Dept. Computer Architecture, University of Tuebingen, Germany
12  //
13  //  This program is free software; you can redistribute it and/or modify
14  //  it under the terms of the GNU General Public License as published by
15  //  the Free Software Foundation version 2 of the License.
16  //
17  //  This program is distributed in the hope that it will be useful,
18  //  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20  //  GNU General Public License for more details.
21  ///////////////////////////////////////////////////////////////////////////////
22  package joelib.gui.molviewer.java3d.util;
23  
24  
25  /*==========================================================================*
26   * IMPORTS
27   *========================================================================== */
28  import java.util.*;
29  
30  
31  /*==========================================================================*
32   * CLASS DECLARATION
33   *========================================================================== */
34  
35  /**
36   * Description of the Class
37   *
38   * @author     wegnerj
39   * @license    GPL
40   * @cvsversion    $Revision: 1.2 $, $Date: 2003/08/19 13:11:26 $
41   */
42  public class CentralLookup
43  {
44      //~ Static fields/initializers /////////////////////////////////////////////
45  
46      private static CentralLookup lookup = null;
47  
48      //~ Instance fields ////////////////////////////////////////////////////////
49  
50      private Hashtable objectTable;
51  
52      //~ Constructors ///////////////////////////////////////////////////////////
53  
54      /**
55       *Constructor for the CentralLookup object
56       */
57      CentralLookup()
58      {
59          objectTable = new Hashtable();
60      }
61  
62      //~ Methods ////////////////////////////////////////////////////////////////
63  
64      /*-------------------------------------------------------------------------*
65       * constructor
66       *------------------------------------------------------------------------- */
67  
68      /**
69       * Gets the lookup attribute of the CentralLookup class
70       *
71       * @return   The lookup value
72       */
73      public static CentralLookup getLookup()
74      {
75          if (lookup == null)
76          {
77              init();
78          }
79  
80          return lookup;
81      }
82  
83      /**
84       * Gets the object attribute of the CentralLookup object
85       *
86       * @param name  Description of the Parameter
87       * @return      The object value
88       */
89      public Object getObject(String name)
90      {
91          return objectTable.get(name);
92      }
93  
94      /**
95       * Adds a feature to the Object attribute of the CentralLookup object
96       *
97       * @param name    The feature to be added to the Object attribute
98       * @param object  The feature to be added to the Object attribute
99       */
100     public void addObject(String name, Object object)
101     {
102         objectTable.put(name, object);
103     }
104 
105     /*-------------------------------------------------------------------------*
106      * public member variables
107      *------------------------------------------------------------------------- */
108 
109     /**
110      * Description of the Method
111      */
112     private static void init()
113     {
114         lookup = new CentralLookup();
115     }
116 }
117 ///////////////////////////////////////////////////////////////////////////////
118 //  END OF FILE.
119 ///////////////////////////////////////////////////////////////////////////////