au.gov.tas.dpiwe.mr.tool
Class HowMany

java.lang.Object
  extended by au.gov.tas.dpiwe.mr.tool.HowMany

public class HowMany
extends Object

This tool counts how many entries are on a line or in a file.

An entry is a "word" surrounded by whitespace, or a non-blank line in a file.

Since:
Mr Architecture 3.0
Version:
1.0.0.0
Author:
Kade Hansson

Constructor Summary
HowMany()
           
 
Method Summary
static int howMany(Reader input)
          Counts the number of "words" on a line, or non-blank lines in a file.
static void main(String[] argv)
          Initiates the HowMany tool.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HowMany

public HowMany()
Method Detail

main

public static void main(String[] argv)
                 throws Exception
Initiates the HowMany tool.

Parameters:
argv - an (optional) switch indicating that one is to be subtracted.
Throws:
Exception - if something goes wrong.

howMany

public static int howMany(Reader input)
                   throws IOException
Counts the number of "words" on a line, or non-blank lines in a file.

Parameters:
input - the file or line.
Returns:
the number of "words" or lines.
Throws:
IOException - if the decoding could not proceed for whatever reason.