001package de.hdm_stuttgart.mi.sd1.htmlformat;
002
003import java.io.PrintStream;
004
005/**
006 * Formatting {@link Address} records. The generated
007 * output layout can be described as:
008 * 
009 *   ******************************
010 *   * head                       *
011 *   ******************************
012 *   *                            *
013 *   *  body                      *
014 *   *                            *
015 *   ******************************
016 *   * tail                       *
017 *   ******************************
018 */
019public interface AddressFormatter {
020
021  /**
022   * When formatting an address list this method
023   * will be called exactly once initiating
024   * output to the head section.
025   * 
026   * @param out The output stream
027   */
028  public void printHead (PrintStream out);
029  
030  /**
031   * This method will be called for each address record.
032   * Corresponding data will populate the body section.
033   * 
034   * @param address The current address record.
035   * @param out The output stream.
036   */
037  public void printRecord(Address address, PrintStream out);
038  /**
039   * When formatting an address list this method
040   * will be called at last to finish
041   * output generation of the tail section.
042   * 
043   * @param out The output stream
044   */
045  public void printTail (PrintStream out);
046}