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

Quick Search    Search Deep

Source code: com/flexstor/common/util/FlexHashtable.java


1   /*
2    * FlexHashtable.java
3    *
4    * Copyright $Date: 2003/08/11 02:22:30 $ FLEXSTOR.net Inc.
5    *
6    * This work is licensed for use and distribution under license terms found at
7    * http://www.flexstor.org/license.html
8    *
9    */
10  
11  package com.flexstor.common.util;
12  
13  import java.util.Date;
14  
15  /**
16  * This class contains useful methods for retrieving specific objects out of a Hashtable
17  * It is our very own extension of java.util.Hashtable
18  */
19  public class FlexHashtable
20     extends java.util.Hashtable
21  {
22     public Boolean getBoolean( String sKey )
23     {
24        try
25        {
26           return (Boolean) super.get( sKey );
27        }
28        catch( ClassCastException cce )
29        {
30           return null;
31        }
32     }
33     
34     public String getString( String sKey )
35     {
36        try
37        {
38           return (String) super.get( sKey );
39        }
40        catch( ClassCastException cce )
41        {
42           return null;
43        }
44     }
45     
46     public Date getDate(String sKey)
47     {
48         try
49         {
50           return (Date) super.get( sKey );
51        }
52        catch( ClassCastException cce )
53        {
54           return null;
55        }
56      
57     }
58     
59     
60     public Integer getInteger( String sKey )
61     {
62        try
63        {
64           return (Integer) super.get( sKey );
65        }
66        catch( ClassCastException cce )
67        {
68           return null;
69        }
70     }
71     
72     public Long getLong( String sKey )
73     {
74        try
75        {
76           return (Long) super.get( sKey );
77        }
78        catch( ClassCastException cce )
79        {
80           return null;
81        }
82     }
83     
84     public Object getObject( String sKey )
85     {
86        return super.get( sKey );
87     }
88  }