|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.acm.seguin.metrics.LineCounter
public class LineCounter
Counts the number of lines in a file
Constructor Summary | |
---|---|
LineCounter(java.io.File init)
Constructor for the LineCounter object |
Method Summary | |
---|---|
protected int |
countCharacter(int ch,
java.io.InputStream in)
Counts how many lines a character counts as (depends on next character sometimes) |
int |
countLines()
Counts the number of lines in a file |
static void |
main(java.lang.String[] args)
Main program |
int |
printMessage()
Prints the message |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LineCounter(java.io.File init)
init
- File to countMethod Detail |
---|
public int countLines()
public int printMessage()
protected int countCharacter(int ch, java.io.InputStream in) throws java.io.IOException
ch
- The character to be countedin
- The input stream
java.io.IOException
- Thrown if unable to read from the input streampublic static void main(java.lang.String[] args)
args
- Command line arguments
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |