100_lecture30

100_lecture30 - Class 30: Lab: Streams November 29, 2005...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Class 30: Lab: Streams November 29, 2005 Introduction to Computation and Problem Solving Class 30: Lab: Streams November 29, 2005 Prof. Steven R. Lerman and Dr. V. Judson Harward 2 The Logger Application 1 Goals Using the framework of the Logger application, we are going to explore three ways to read and write data using Java streams: 1. as text 2. as binary data 3. as serialized objects 3 Logger Architecture Logger.java: • provides main( ) and GUI • generates log data (" Log ") as Date objects • summarizes and performs minimal validity check (" Summarize "); • selects File s for reading and writing using a JFileChooser • calls methods in LoggerIO to perform reading and writing of data You are going to write those methods. 4 2 java.util.LinkedList • java.util.LinkedList possesses the same methods as our SLinkedList and many others. • Logger uses a LinkedList to hold the log data, and it passes the list in calls to the LoggerIO methods you will have to write. For instance: void saveToText( List list, File f ) 5 Logger Exercise • Download the two files Logger.java and LoggerIO.java in the .zip file Lecture30.zip from the class web site. • Save them both to a new directory. • Create a new project based on the directory into which you just saved the two java files. Compile the project and test it. Try to save to a file in text mode. Did you create a file? Was there anything in it? (Look at it with the Windows Notepad application)....
View Full Document

This note was uploaded on 11/29/2011 for the course CIVIL 1.00 taught by Professor Georgekocur during the Spring '05 term at MIT.

Page1 / 8

100_lecture30 - Class 30: Lab: Streams November 29, 2005...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online