net.sf.statcvs.model
Class Directory
- Comparable
public abstract class Directory
implements Comparable
$Id: Directory.java,v 1.11 2008/04/02 11:22:16 benoitx Exp $ int | compareTo(Object o) - Compares this directory to another one, based on their full names.
|
static Directory | createRoot() - Factory method for creating a new root directory.
|
Directory | createSubdirectory(String name) - Factory method for creating a new subdirectory.
|
int | getCurrentFileCount() - Returns the number of files in this directory.
|
int | getCurrentLOC() - Returns the number of lines in this directory.
|
abstract int | getDepth() - Returns the level of this directory in the direcotry tree.
|
SortedSet | getFiles() - Returns all
VersionedFile objects in this directory, ordered
by filename.
|
abstract String | getName() - Returns the directory's name without full path or any slashes,
for example "src".
|
abstract Directory | getParent() - Returns the directory's parent directory or null if it is the root
|
abstract String | getPath() - Returns the directory's full path with trailing slash,
for example "src/net/sf/statcvs/".
|
SortedSet | getRevisions() - Returns all
Revision s to files in
this directory, in order from oldest to most recent.
|
SortedSet | getSubdirectories() - Returns a SortedSet of all immediate subdirectories,
ordered by name.
|
SortedSet | getSubdirectoriesRecursive() - Returns a list of all subdirectories, including their subdirectories
and this directory itself.
|
boolean | isEmpty() - Returns
true if all files in this directory and its
subdirectories are deleted, or if it doesn't have any files and
subdirectories at all.
|
abstract boolean | isRoot() - Returns true if this is the root of the directory tree.
|
compareTo
public int compareTo(Object o)
Compares this directory to another one, based on their full names.
createRoot
public static Directory createRoot()
Factory method for creating a new root directory.
createSubdirectory
public Directory createSubdirectory(String name)
Factory method for creating a new subdirectory.
name
- the subdirectory's name
- the subdirectory instance
getCurrentFileCount
public int getCurrentFileCount()
Returns the number of files in this directory. Deleted files are not
counted.
- number of files in this directory
getCurrentLOC
public int getCurrentLOC()
Returns the number of lines in this directory. The returned number
will be for the current revisions of all files.
getDepth
public abstract int getDepth()
Returns the level of this directory in the direcotry tree.
The root has level 0, its subdirectories have level 1, and so forth.
- the level of this directory in the directory tree
getFiles
public SortedSet getFiles()
Returns all
VersionedFile
objects in this directory, ordered
by filename. Files in subdirectories are not included.
- the files in this directory
getName
public abstract String getName()
Returns the directory's name without full path or any slashes,
for example "src".
getParent
public abstract Directory getParent()
Returns the directory's parent directory or null if it is the root
getPath
public abstract String getPath()
Returns the directory's full path with trailing slash,
for example "src/net/sf/statcvs/".
getRevisions
public SortedSet getRevisions()
Returns all
Revision
s to files in
this directory, in order from oldest to most recent.
- list of Revisions for this directory
getSubdirectories
public SortedSet getSubdirectories()
Returns a SortedSet of all immediate subdirectories,
ordered by name.
getSubdirectoriesRecursive
public SortedSet getSubdirectoriesRecursive()
Returns a list of all subdirectories, including their subdirectories
and this directory itself. The list is preordered, beginning with this
directory itself.
isEmpty
public boolean isEmpty()
Returns true
if all files in this directory and its
subdirectories are deleted, or if it doesn't have any files and
subdirectories at all.
true
if the directory is currently empty
isRoot
public abstract boolean isRoot()
Returns true if this is the root of the directory tree.
- true if this is the root of the directory tree