
/**
 * A dictionary entry data structure, containing a word and its definition.
 *
 * @author Blanca Polo
 * @author Zach Tomaszewski
 * @version 18 Nov 2003
 */

public class DictionaryEntry implements Comparable{

  private String word;
  private String definition;

  /**
   * Creates a new DictionaryEntry containing the given word and definition.
   */
  public DictionaryEntry (String word, String definition){
    this.setWord(word);
    this.setDefinition(definition);
  }

  
  /**
   * Updates this entry's word.
   *
   * @param newWord  replaces this entry's current word
   */
  public void setWord(String newWord){
    word = newWord;
  }


  /**
   * Updates this entry's definition.
   *
   * @param newDef  replaces this entry's current definition
   */
  public void setDefinition(String newDef){
    definition = newDef;
  }
  

  /**
   * Returns this entry's word.
   */
  public String getWord ( ){
    return word;
  }


  /**
   * Returns this entry's definition.
   */
  public String getDefinition( ){
    return definition;
  }
  

  /**
   * Returns this entry's contents as a String
   * in a friendly readable way.
   * @return  this dictionary entry as a String       
   */
  public String toString (){
//write this method
  }
  
  
  /**
   * Compares this dictionary entry to the given entry to
   * determine their relative ordering.  
   * Sorts entries alphabetically and case-insensatively based on their
   * words.  (It does not compare their definitions.)
   * 
   * @param dictEntry   the entry to compare to this entry object
   * @return   -1 if this entry should come before dictEntry,
   *           +1 if dictEntry should come before this entry,
   *           or 0 if the two share the same word.
   */
  public int compareTo (Object dictEntry){
     DictionaryEntry entry = (DictionaryEntry) dictEntry;
//write this method
  }


} //end class
