org.acm.seguin.metrics
Class LCTraversal

java.lang.Object
  extended by org.acm.seguin.io.DirectoryTreeTraversal
      extended by org.acm.seguin.metrics.LCTraversal
All Implemented Interfaces:
java.lang.Runnable

public class LCTraversal
extends DirectoryTreeTraversal

Counts the number of lines in a file

Author:
Chris Seguin

Constructor Summary
LCTraversal(java.lang.String init)
          Traverses a directory tree structure
 
Method Summary
protected  boolean isTarget(java.io.File currentFile)
          Determines if this file should be handled by this traversal
static void main(java.lang.String[] args)
          Main program
 void run()
          Starts the tree traversal
protected  void visit(java.io.File currentFile)
          Visits the current file
 
Methods inherited from class org.acm.seguin.io.DirectoryTreeTraversal
arriveAtDir, isAllowed, leaveDir, traverse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LCTraversal

public LCTraversal(java.lang.String init)
Traverses a directory tree structure

Parameters:
init - the initial directory
Method Detail

run

public void run()
Starts the tree traversal

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class DirectoryTreeTraversal

isTarget

protected boolean isTarget(java.io.File currentFile)
Determines if this file should be handled by this traversal

Specified by:
isTarget in class DirectoryTreeTraversal
Parameters:
currentFile - the current file
Returns:
true if the file should be handled

visit

protected void visit(java.io.File currentFile)
Visits the current file

Specified by:
visit in class DirectoryTreeTraversal
Parameters:
currentFile - the current file

main

public static void main(java.lang.String[] args)
Main program

Parameters:
args - Command line arguments