net.sf.statcvs.model
Class CvsModule

java.lang.Object
  extended bynet.sf.statcvs.model.CvsModule

public class CvsModule
extends java.lang.Object

Representation of a CVS module. May be the root of a project or any of its subfolders

Version:
$Id: CvsModule.java,v 1.21 2003/03/18 10:33:55 lukasz Exp $
Author:
Lukasz Pekacki, Manuel Schulze, Richard Cyganiak

Constructor Summary
CvsModule(CvsContent content, CvsModule father, java.lang.String name)
          Constructor CvsModule
 
Method Summary
 void addChild(CvsModule childModule)
          Adds a child module into this module
 boolean allFilesDeleted()
          Returns true if all files in this module and its children are deleted.
 CvsModule getChild(java.lang.String childPath)
          Returns a child module, specified by pathname
protected  java.util.Iterator getChildrenIterator()
          Returns an iterator over the children list of this module.
 int getCurrentFileCount()
          Returns the number of files in this module.
 int getDeletedFileCount()
          Returns the number of deleted files in this module.
 int getDepth()
          Returns the depth of this module in the tree.
 CvsModule getFather()
          Returns the father of this module.
 java.util.Iterator getFileIterator()
          Returns an iterator of CvsFiles over the files in this module only.
 int getLinesInModule()
          Returns the number of code lines in this module.
 java.lang.String getName()
          Returns the name of this module without its path.
 int getNumberOfChildren()
          Method getNumberOfChildren.
 java.lang.String getPath()
          Returns the path.
 boolean isRoot()
          Returns true if this module is the root module.
 CvsTreeIterator iterator()
          Returns a CvsTreeIterator which can be used to traverse the hole subtree of this module including this module.
 java.lang.String toString()
          Returns a string representation of this module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CvsModule

public CvsModule(CvsContent content,
                 CvsModule father,
                 java.lang.String name)
Constructor CvsModule

Parameters:
name - - name of the directory of this module
content - content object
father - module of this module
Method Detail

addChild

public void addChild(CvsModule childModule)
Adds a child module into this module

Parameters:
childModule - child to add

getDepth

public int getDepth()
Returns the depth of this module in the tree.

Returns:
The depth.

getChild

public CvsModule getChild(java.lang.String childPath)
Returns a child module, specified by pathname

Parameters:
childPath - path of the child
Returns:
CvsModule child module

getFileIterator

public java.util.Iterator getFileIterator()
Returns an iterator of CvsFiles over the files in this module only.

Returns:
An iterator of this modules files.

getLinesInModule

public int getLinesInModule()
Returns the number of code lines in this module. The returned number will be for the newest revisions of all files.

Returns:
the number of code lines in this module

getCurrentFileCount

public int getCurrentFileCount()
Returns the number of files in this module. Deleted files are not counted.

Returns:
The number of files in this module

getDeletedFileCount

public int getDeletedFileCount()
Returns the number of deleted files in this module.

Returns:
The number of deleted files in this module

getChildrenIterator

protected java.util.Iterator getChildrenIterator()
Returns an iterator over the children list of this module.

Returns:
Iterator over the children.

iterator

public CvsTreeIterator iterator()
Returns a CvsTreeIterator which can be used to traverse the hole subtree of this module including this module.

Returns:
A CvsTreeIterator

toString

public java.lang.String toString()
Returns a string representation of this module.

Returns:
The string representation.

getNumberOfChildren

public int getNumberOfChildren()
Method getNumberOfChildren.

Returns:
int

isRoot

public boolean isRoot()
Returns true if this module is the root module.

Returns:
True, if this is the root module

getPath

public java.lang.String getPath()
Returns the path.

Returns:
String path of the module

getFather

public CvsModule getFather()
Returns the father of this module.

Returns:
The father or null if this module is the root.

getName

public java.lang.String getName()
Returns the name of this module without its path.

Returns:
The name of this module.

allFilesDeleted

public boolean allFilesDeleted()
Returns true if all files in this module and its children are deleted.

Returns:
true if all files are deleted