net.sf.statcvs.model
public abstract class Directory extends Object implements Comparable
Repository
, a
container for VersionedFile
s and subDirectorys.
A new root directory is created by createRoot()
.
The createSubdirectory(java.lang.String)
method creates new subdirectories.
TODO: Rename getCurrentLOC to getCurrentLines or getCurrentLineCountConstructor and Description |
---|
Directory() |
Modifier and Type | Method and Description |
---|---|
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.
|
public static Directory createRoot()
public Directory createSubdirectory(String name)
name
- the subdirectory's namepublic abstract String getName()
public abstract String getPath()
public abstract Directory getParent()
public abstract boolean isRoot()
public abstract int getDepth()
public SortedSet getFiles()
VersionedFile
objects in this directory, ordered
by filename. Files in subdirectories are not included.public SortedSet getRevisions()
Revision
s to files in
this directory, in order from oldest to most recent.public SortedSet getSubdirectories()
Directory
objectspublic SortedSet getSubdirectoriesRecursive()
Directory
objectspublic int getCurrentLOC()
public int getCurrentFileCount()
public boolean isEmpty()
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 emptypublic int compareTo(Object o)
compareTo
in interface Comparable
Comparable.compareTo(java.lang.Object)