/**
   An item contains a key and an element.
  
   @author      Franck van Breugel
   @version     1.3    June 27, 2000
*/
public class Item 
{
    private Object key;
    private Object element;

    /** 
       Constructs an item with specified key and element. 

       @param key The key of this item.
       @param element The element of this item.
    */
    public Item(Object key, Object element) 
    {
        this.key = key;
        this.element = element;
    }

    /** 
       Returns the key of this item.

       @return The key of this item.
    */
    public Object key() 
    {
        return key;
    }

    /** 
       Returns the element of this item.

       @return The element of this item.
    */
    public Object element() 
    {
        return element;
    }

    /**
       Sets the key of this item to the specified key.

       @param key The new key of this item.
    */
    public void setKey(Object key) 
    {
        this.key = key;
    }

    /**
       Sets the element of this item to the specified key.

       @param element The new element of this item.
    */
    public void setElement(Object element) 
    {
        this.element = element;
    }

    /**
       Returns a string representation of this item.

       @return A string representation of this item.
    */
    public String toString() 
    {
        return "(key = " + key + ", element = " + element + ")";
    }
}
