com.redhat.rhn.common.util
Class CharacterMap

java.lang.Object
  extended by com.redhat.rhn.common.util.CharacterMap

public class CharacterMap
extends java.lang.Object

An wrapper around HashMap that ONLY acccepts java.lang.Characters and java.lang.Integers. 5.0: This class should be removed once we switch to Java 5.0 and we get Generics.


Constructor Summary
CharacterMap()
          public constructor
 
Method Summary
 boolean containsKey(char charTest)
          Check to see if the map contains this character
 boolean containsKey(java.lang.Character charTest)
          Check to see if the map contains this character
 boolean equals(java.lang.Object o)
          
 java.lang.Integer get(char key)
          Retrieve value
 java.lang.Integer get(java.lang.Character key)
          Retrieve value
 int hashCode()
          Implement hashCode for CharacterMap
 void put(java.lang.Character charIn, java.lang.Integer intIn)
          Add charIn and intIn to the map.
 void put(char charIn, int intIn)
          Add charIn and intIn to the map.
 int size()
          Implement size function for CharacterMap
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CharacterMap

public CharacterMap()
public constructor

Method Detail

put

public void put(java.lang.Character charIn,
                java.lang.Integer intIn)
Add charIn and intIn to the map.

Parameters:
charIn - Character to add
intIn - Integer to add

put

public void put(char charIn,
                int intIn)
Add charIn and intIn to the map.

Parameters:
charIn - Character to add
intIn - Integer to add

get

public java.lang.Integer get(java.lang.Character key)
Retrieve value

Parameters:
key - Character you want the starting position of
Returns:
Integer for corresponding key

get

public java.lang.Integer get(char key)
Retrieve value

Parameters:
key - Character you want the starting position of
Returns:
Integer for corresponding key

containsKey

public boolean containsKey(java.lang.Character charTest)
Check to see if the map contains this character

Parameters:
charTest - The character to test
Returns:
true if the character is in the map, false otherwise

containsKey

public boolean containsKey(char charTest)
Check to see if the map contains this character

Parameters:
charTest - The character to test
Returns:
true if the character is in the map, false otherwise

size

public int size()
Implement size function for CharacterMap

Returns:
Number of elements in CharacterMap

equals

public boolean equals(java.lang.Object o)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Implement hashCode for CharacterMap

Overrides:
hashCode in class java.lang.Object
Returns:
hashCode for innerMap

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object