wt.fc
Class WTStringMap

java.lang.Object
  extended bywt.fc.WTStringMap
All Implemented Interfaces:
Externalizable, Serializable

public class WTStringMap
extends Object
implements Externalizable

WTStringMap class maps keys to values. Both the keys and the values must be of type String. A map contains no duplicate keys; each key can map to at most one value.



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
private  boolean dirty
           
static long EXTERNALIZATION_VERSION_UID
           
private  String mapString
           
protected static long OLD_FORMAT_VERSION_UID
           
private static String RESOURCE
           
(package private) static long serialVersionUID
           
(package private)  Hashtable stringTable
           
 
Constructor Summary
WTStringMap()
          No arg constructor.
WTStringMap(String value)
          Constructor that takes as argument a String in the internal representation format (even number of comma separated strings).
 
Method Summary
 void clear()
          Removes all mappings from this map.
 boolean containsKey(String key)
          Returns true if this map contains a mapping for the specified key.
 boolean containsValue(String value)
          Returns true if this map maps one or more keys to the specified value.
 boolean equals(Object obj)
          Compares the specified object with this map for equality.
 String get(String key)
          Returns the value to which this map maps the specified key.
protected  String getMapString()
          Gets the value of the attribute: mapString; Internal representation of the map.
 int hashCode()
          Returns hash code.
 boolean isEmpty()
          Returns true if this map contains no key-value mappings.
 Enumeration keys()
          Returns am emumeration with the keys contained in this map.
private  void mapStringValidate(String a_MapString)
           
 String put(String key, String value)
          Associates the specified value with the specified key in this map.
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(WTStringMap thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
 String remove(String key)
          Removes the mapping for this key from this map if present.
protected  void setMapString(String a_MapString)
          Sets the value of the attribute: mapString; Internal representation of the map.
private  void setStringValue()
           
private  void setTable()
           
 int size()
          Returns the number of key-value mappings in this map.
 String toString()
          Returns the internal string representation of the object.
 Enumeration values()
          Returns an enumeration with the values contained in this map.
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

mapString

private String mapString

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

stringTable

Hashtable stringTable

dirty

private boolean dirty
Constructor Detail

WTStringMap

public WTStringMap()
No arg constructor.

Supported API: false


WTStringMap

public WTStringMap(String value)
            throws DatastoreException
Constructor that takes as argument a String in the internal representation format (even number of comma separated strings).

Supported API: false

Parameters:
value -
Throws:
DatastoreException
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(WTStringMap thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getMapString

protected String getMapString()
Gets the value of the attribute: mapString; Internal representation of the map. If not null (empty map) it is composed of a comma separated list of keys and values.

Supported API: false

Returns:
String

setMapString

protected void setMapString(String a_MapString)
                     throws WTPropertyVetoException
Sets the value of the attribute: mapString; Internal representation of the map. If not null (empty map) it is composed of a comma separated list of keys and values.

Supported API: false

Parameters:
a_MapString -
Throws:
WTPropertyVetoException

mapStringValidate

private void mapStringValidate(String a_MapString)
                        throws WTPropertyVetoException
Parameters:
a_MapString -
Throws:
WTPropertyVetoException

toString

public String toString()
Returns the internal string representation of the object. Can be null.

Supported API: false

Returns:
String

clear

public void clear()
Removes all mappings from this map.

Supported API: false


containsKey

public boolean containsKey(String key)
Returns true if this map contains a mapping for the specified key.

Supported API: false

Parameters:
key -
Returns:
boolean

containsValue

public boolean containsValue(String value)
Returns true if this map maps one or more keys to the specified value. More formally, returns true if and only if this map contains at least one mapping to a value v such that (value==null ? v==null : value.equals(v)).

Supported API: false

Parameters:
value -
Returns:
boolean

equals

public boolean equals(Object obj)
Compares the specified object with this map for equality. Returns true if the given object is also a map and the two WTStringMaps represent the same mappings. More formally, two maps t1 and t2 represent the same mappings if t1.entrySet().equals(t2.entrySet()).

Supported API: false

Parameters:
obj -
Returns:
boolean

get

public String get(String key)
Returns the value to which this map maps the specified key. Returns null if the map contains no mapping for this key. A return value of null does indicates that the map contains no mapping for the key.

Supported API: false

Parameters:
key -
Returns:
String

isEmpty

public boolean isEmpty()
Returns true if this map contains no key-value mappings.

Supported API: false

Returns:
boolean

keys

public Enumeration keys()
Returns am emumeration with the keys contained in this map.

Supported API: false

Returns:
Enumeration

put

public String put(String key,
                  String value)
Associates the specified value with the specified key in this map. If the map previously contained a mapping for this key, the old value is replaced. Returns previous value associated with specified key, or null if there was no mapping for key.

Supported API: false

Parameters:
key -
value -
Returns:
String

remove

public String remove(String key)
Removes the mapping for this key from this map if present. Returns previous value associated with specified key, or null if there was no mapping for key.

Supported API: false

Parameters:
key -
Returns:
String

size

public int size()
Returns the number of key-value mappings in this map.

Supported API: false

Returns:
int

values

public Enumeration values()
Returns an enumeration with the values contained in this map.

Supported API: false

Returns:
Enumeration

hashCode

public int hashCode()
Returns hash code.

Supported API: false

Returns:
int

setTable

private void setTable()

setStringValue

private void setStringValue()