com.plumtree.openfoundation.util
Class XPStringDictionary

java.lang.Object
  extended bycom.plumtree.openfoundation.util.XPStringDictionary

public class XPStringDictionary
extends java.lang.Object

Implements a hashtable with the key strongly typed to be a string rather than an object.

NOTE: XPStringDictionary always handles keys in a case-SENSITIVE manner. Microsoft's implementation of the .NET "StringDictionary" framework class handles keys in a case-INSENSITIVE manner; StringDictionary translates all keys to lower case before it is used with the dictionary. Therefore, XPStringDictionary doesn't actually use StringDictionary on .NET.

Author:
danielf

Constructor Summary
XPStringDictionary()
          Constructs and XPStringDictionary Object with no Arguments.
XPStringDictionary(XPHashtable properties)
          Constructs an XPStringDictionary Object with given Properties.
 
Method Summary
 void Clear()
          Removes all elements from this XPStringDictionary.
 boolean ContainsKey(java.lang.String key)
          Checks if the Key passed to exists in this XPStringDictionary.
 boolean ContainsValue(java.lang.String _value)
          Checks if the value passed to exists in this XPStringDictionary.
 java.lang.String GetElement(java.lang.String key)
          Returns the Element in the XPStringDictionary.
 IXPEnumerator GetKeys()
          Returns an Enumerator for all the Keys in this XPStringDictionary.
 int GetSize()
          Gives the size of this XPStringDictionary.
 XPHashtable GetUnderlyingObject()
          Returns the underlying data structure for this XPStringDictionary.
 boolean IsEmpty()
          Checks if the current XPStringDictionary is empty or not.
 java.lang.String PutElement(java.lang.String key, java.lang.String value)
          Maps the specified key to the specified value in this XPStringDictionary.
 void RemoveElement(java.lang.String key)
          Removes the Element for a given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPStringDictionary

public XPStringDictionary()
Constructs and XPStringDictionary Object with no Arguments.


XPStringDictionary

public XPStringDictionary(XPHashtable properties)
Constructs an XPStringDictionary Object with given Properties.

Parameters:
properties - as an XPHashtable.
Method Detail

ContainsKey

public boolean ContainsKey(java.lang.String key)
Checks if the Key passed to exists in this XPStringDictionary.

Parameters:
key - The key to be verified.
Returns:
true if the key exists in XPStringDictionary or else false.

ContainsValue

public boolean ContainsValue(java.lang.String _value)
Checks if the value passed to exists in this XPStringDictionary.

Parameters:
_value - The value to be verified.
Returns:
true if the value exists in XPStringDictionary or else false.

GetKeys

public IXPEnumerator GetKeys()
Returns an Enumerator for all the Keys in this XPStringDictionary.

Returns:
IXPEnumerator to enumerate through all the keys.

GetElement

public java.lang.String GetElement(java.lang.String key)
Returns the Element in the XPStringDictionary.

Parameters:
key - for the Element to be returned.
Returns:
String value of the Element stored.

PutElement

public java.lang.String PutElement(java.lang.String key,
                                   java.lang.String value)
Maps the specified key to the specified value in this XPStringDictionary. Neither the key nor the value can be null.

Parameters:
key - the XPStringDictionary key.
value - is the new value to be stored.
Returns:
Previous value of the key specified. Null if no previous value exists for given key.

RemoveElement

public void RemoveElement(java.lang.String key)
Removes the Element for a given key.

Parameters:
key - value for the element to be removed, it can't be null.

GetSize

public int GetSize()
Gives the size of this XPStringDictionary.

Returns:
the int value of the size.

GetUnderlyingObject

public XPHashtable GetUnderlyingObject()
Returns the underlying data structure for this XPStringDictionary.

Returns:
an XPHashtable for this XPStringDictionary.

Clear

public void Clear()
Removes all elements from this XPStringDictionary.


IsEmpty

public boolean IsEmpty()
Checks if the current XPStringDictionary is empty or not.

Returns:
true if this is empty or else false.


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.