com.javaranch.common
Class CastMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.HashMap
              |
              +--com.javaranch.common.CastMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class CastMap
extends java.util.HashMap

This hashtable gives some extra casting help.

- - - - - - - - - - - - - - - - -

Copyright (c) 1999-2004 Paul Wheaton

You are welcome to do whatever you want to with this source file provided that you maintain this comment fragment (between the dashed lines). Modify it, change the package name, change the class name ... personal or business use ... sell it, share it ... add a copyright for the portions you add ...

My goal in giving this away and maintaining the copyright is to hopefully direct developers back to JavaRanch.

The original source can be found at JavaRanch

- - - - - - - - - - - - - - - - -

Author:
Paul Wheaton
See Also:
Serialized Form

Constructor Summary
CastMap()
           
 
Method Summary
 java.lang.String getString(java.lang.String key)
           
 java.lang.String getTrimmedString(java.lang.String key)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

CastMap

public CastMap()
Method Detail

getString

public java.lang.String getString(java.lang.String key)
Parameters:
key - - the key whose associated value is to be returned.
Returns:
the value, cast to a String, to which this map maps the specified key, or the String "null" if the map contains no mapping for this key.

getTrimmedString

public java.lang.String getTrimmedString(java.lang.String key)
Parameters:
key - - the key whose associated value is to be returned.
Returns:
the value, cast to a String and trimmed of white space, to which this map maps the specified key, or the String "null" if the map contains no mapping for this key.


Copyright ©2004 Paul Wheaton All Rights Reserved