net.sf.statcvs.model
Class DirectoryImpl

java.lang.Object
  |
  +--net.sf.statcvs.model.Directory
        |
        +--net.sf.statcvs.model.DirectoryImpl
All Implemented Interfaces:
java.lang.Comparable

public class DirectoryImpl
extends Directory

A concrete directory in a directory tree. Implementation of the Directory interface.

Version:
$Id: DirectoryImpl.java,v 1.3 2003/06/02 22:46:57 cyganiak Exp $
Author:
Richard Cyganiak

Constructor Summary
DirectoryImpl(Directory parent, java.lang.String name)
          Creates a new Directory with the given parent and name
 
Method Summary
 int getDepth()
           
 java.lang.String getName()
          Returns the directory's name without full path or any slashes, e.g.
 Directory getParent()
          Returns the directory's parent directory or null if it is the root
 java.lang.String getPath()
          Returns the directory's full path with trailing slash, for example "src/net/sf/statcvs/"
 boolean isRoot()
           
 java.lang.String toString()
           
 
Methods inherited from class net.sf.statcvs.model.Directory
addFile, addSubdirectory, compareTo, getCurrentFileCount, getCurrentLOC, getFiles, getRevisionIterator, getSubdirectories, getSubdirectoriesRecursive, isEmpty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectoryImpl

public DirectoryImpl(Directory parent,
                     java.lang.String name)
Creates a new Directory with the given parent and name

Parameters:
parent - the parent directory
name - the directory's name without path or slashes
Method Detail

getName

public java.lang.String getName()
Description copied from class: Directory
Returns the directory's name without full path or any slashes, e.g. "src"

Specified by:
getName in class Directory
Returns:
the directory's name
See Also:
Directory.getName()

getPath

public java.lang.String getPath()
Description copied from class: Directory
Returns the directory's full path with trailing slash, for example "src/net/sf/statcvs/"

Specified by:
getPath in class Directory
Returns:
the directory's path
See Also:
Directory.getPath()

getParent

public Directory getParent()
Description copied from class: Directory
Returns the directory's parent directory or null if it is the root

Specified by:
getParent in class Directory
Returns:
the directory's parent
See Also:
Directory.getParent()

isRoot

public boolean isRoot()
Specified by:
isRoot in class Directory
Returns:
true if this is the root of the directory tree
See Also:
Directory.isRoot()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getDepth

public int getDepth()
Specified by:
getDepth in class Directory
Returns:
the level of this directory in the directory tree. 0 for the root.
See Also:
Directory.getDepth()