CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ | Grades

Files

Text and Binary Files
Text files
Interface with file I/O

The ProductDAO interface

public interface ProductDAO extends ProductReader, ProductWriter, ProductConstants {}

The ProductReader interface

import java.util.ArrayList;

public interface ProductReader
{
    Product getProduct(String code);
    ArrayList getProducts();
}

The ProductWriter interface

public interface ProductWriter
{
    boolean addProduct(Product p);
    boolean updateProduct(Product p);
    boolean deleteProduct(Product p);
}

The ProductConstants interface

public interface ProductConstants
{
    int CODE_SIZE = 4;
    int DESCRIPTION_SIZE = 40;
}
Previous | Connect a character output stream to a file | Write to a text file | Connect a character input stream to a file | Read from a text file | Interface with file I/O | Class with a text file | Next