Class Letter

java.lang.Object
  |
  +--java.util.Observable
        |
        +--Letter
All Implemented Interfaces:
Observer

public class Letter
extends Observable
implements Observer

A letter to be sorted at the post office.


Field Summary
 Address address
          Address for this.
 String body
          Message for this.
 
Constructor Summary
Letter(Address anAddress, String aBody)
          Constructs a new letter.
 
Method Summary
 boolean isHighlighted()
          Returns whether or not this should be highlighted.
 void update(Observable anObservable, Object anArgument)
          Updates this when the address is changed.
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

address

public Address address
Address for this.


body

public String body
Message for this.

Constructor Detail

Letter

public Letter(Address anAddress,
              String aBody)
Constructs a new letter.

Parameters:
anAddress - address for the letter
aBody - body for the letter
Method Detail

update

public void update(Observable anObservable,
                   Object anArgument)
Updates this when the address is changed.

Specified by:
update in interface Observer
Parameters:
anObservable - observable that has changed
anArgument - argument for change

isHighlighted

public boolean isHighlighted()
Returns whether or not this should be highlighted.