Java - What methods to put in an interface and what to keep out
Posted
by
lewicki
on Programmers
See other posts from Programmers
or by lewicki
Published on 2012-09-27T18:05:16Z
Indexed on
2012/09/28
3:49 UTC
Read the original article
Hit count: 277
java
|interfaces
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?
© Programmers or respective owner