Java - What methods to put in an interface and what to keep out
- by lewicki
I'm designing a file handler interface:
public interface FileHandler
{
public void openFileHandler(String fileName);
public void closeFileHandler();
public String readLine();
public String [] parseLine(String line);
public String [] checkLine(String line[]);
public void incrementLineCount();
public void incrementLineSuccessCount();
public void incrementLineErrorCount();
public int getLineCount();
public int getLineSuccessCount();
public int getLineErrorCount();
}
It is soon apparent to me that these methods can't be made private. I don't want incrementLineCount to be public.
What is proper way to design an interface like this?