001package edu.pdx.cs410J.apptbook; 002 003import edu.pdx.cs410J.AppointmentBookDumper; 004 005import java.io.PrintWriter; 006import java.io.Writer; 007 008/** 009 * A skeletal implementation of the <code>TextDumper</code> class for Project 2. 010 */ 011public class TextDumper implements AppointmentBookDumper<AppointmentBook> { 012 private final Writer writer; 013 014 public TextDumper(Writer writer) { 015 this.writer = writer; 016 } 017 018 @Override 019 public void dump(AppointmentBook book) { 020 try ( 021 PrintWriter pw = new PrintWriter(this.writer) 022 ) { 023 pw.println(book.getOwnerName()); 024 025 pw.flush(); 026 } 027 028 } 029}