estamp
Class EstampManager

java.lang.Object
  extended byestamp.EstampManager

public class EstampManager
extends java.lang.Object

Title:

Description:

Copyright: Copyright (c) 2003

Company: segy


Constructor Summary
EstampManager()
          Default constructor.
 
Method Summary
 void addEstamp(Estamp estamp)
          Adds a new estamp into the hashtable
 void addEstamp(java.lang.Object key, Estamp estamp)
          Adds a new estamp into the hashtable
 void clear()
          Clears this hashtable so that it contains no keys and no estamps.
(package private) static java.lang.String getDemoString()
           
 java.util.Vector getEstamps(java.lang.Object key)
          Gets the estamps to which the specified key is mapped in this hashtable
(package private) static java.lang.String getHostEmail()
          Gets the host's email address
 java.lang.Object[] getKeys()
          Gets the keys of the estamps contained in this hashtable.
 Estamp getSelectedEstamp(java.lang.Object key, int index)
          Gets the selected estamp in the EstampPanel
(package private) static Vendor getVendor(int index)
          Gets the vendor id specified by index
(package private) static Vendor getVendor(java.lang.String vendorID)
          Gets the vendor id specified by index
static java.util.Vector getVendors()
          Gets all vendor ids
 void loadEstamp()
          Loads estamps from data file, which is saved in XML format
 java.util.Vector remove(java.lang.String key)
          Removes the key (and its corresponding estamps) from this hashtable.
 void saveEstamps()
          Saves estamps to a data file, which is in XML format
 void setEstamp(java.lang.Object key, java.util.Vector newEstamps)
          Maps the specified key to the specified value in this hashtable.
 int size()
          Gets the number of key-estamp mappings in this hashtable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EstampManager

public EstampManager()
Default constructor.

Method Detail

addEstamp

public void addEstamp(Estamp estamp)
Adds a new estamp into the hashtable

Parameters:
estamp - the estamp to be added

addEstamp

public void addEstamp(java.lang.Object key,
                      Estamp estamp)
Adds a new estamp into the hashtable

Parameters:
key - the key of the estamp
estamp - the estamp to be added

clear

public void clear()
Clears this hashtable so that it contains no keys and no estamps.


getDemoString

static java.lang.String getDemoString()

getEstamps

public java.util.Vector getEstamps(java.lang.Object key)
Gets the estamps to which the specified key is mapped in this hashtable

Parameters:
key - the key whose associated estamps are to be returned.
Returns:
the vector of estamps to which this map maps the specified key, or null if the map contains no mapping for this key.

getHostEmail

static java.lang.String getHostEmail()
Gets the host's email address

Returns:
the host email address

getKeys

public java.lang.Object[] getKeys()
Gets the keys of the estamps contained in this hashtable. The key of an estamp is the sender's email address.

Returns:
an array of the keys

getSelectedEstamp

public Estamp getSelectedEstamp(java.lang.Object key,
                                int index)
Gets the selected estamp in the EstampPanel

Parameters:
key - the key of the hashtable
index - the selected estamp
Returns:

getVendor

static Vendor getVendor(int index)
Gets the vendor id specified by index

Parameters:
index - the index of vendor
Returns:
the vendor

getVendor

static Vendor getVendor(java.lang.String vendorID)
Gets the vendor id specified by index

Parameters:
vendorID - the vendor's id
Returns:
the vendor

getVendors

public static java.util.Vector getVendors()
Gets all vendor ids

Returns:
vendor ids

loadEstamp

public void loadEstamp()
Loads estamps from data file, which is saved in XML format


remove

public java.util.Vector remove(java.lang.String key)
Removes the key (and its corresponding estamps) from this hashtable. This method does nothing if the key is not in the hashtable.

Parameters:
key - the key that need to be removed
Returns:
a vector of estamps that the key has been mapped in this hashtable, or null if the key did not have a mapping

saveEstamps

public void saveEstamps()
Saves estamps to a data file, which is in XML format


setEstamp

public void setEstamp(java.lang.Object key,
                      java.util.Vector newEstamps)
Maps the specified key to the specified value in this hashtable. Neither the key nor the value can be null. If the key has mapped with a estamps vector, compare the current estamps with the new estamps and applies the differences.

Parameters:
key - the hashtable key.
newEstamps - the vector of estamps

size

public int size()
Gets the number of key-estamp mappings in this hashtable.

Returns:
the number of key-value mappings in this hashtable.