net.sf.statcvs.model
Class CvsTree

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

public class CvsTree
extends java.lang.Object

Manages CvsTree

Version:
$Id: CvsTree.java,v 1.16 2003/03/18 10:33:55 lukasz Exp $
Author:
Lukasz Pekacki

Field Summary
static int NO_PATH_AVAILABLE
          Konstant for no path avaliable
 
Constructor Summary
CvsTree(CvsContent content)
          Constructor for given content
 
Method Summary
protected  java.lang.String getDirectoryPrefix(java.lang.String path)
          Returns the prefix of a given directory string.
protected  java.lang.String getDirectorySuffix(java.lang.String path)
          Returns the suffix of a given directory string.
 CvsModule getRoot()
          Returns the root.
protected  void insertDir(java.lang.String name)
          Inserts a directory into this tree.
 CvsTreeIterator iterator()
          Returns an CvsTreeIterator over the elements in this tree.
 java.lang.String toString()
          Returns a string representation of this tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_PATH_AVAILABLE

public static final int NO_PATH_AVAILABLE
Konstant for no path avaliable

See Also:
Constant Field Values
Constructor Detail

CvsTree

public CvsTree(CvsContent content)
Constructor for given content

Parameters:
content - to use
Method Detail

getRoot

public CvsModule getRoot()
Returns the root.

Returns:
CvsModule

insertDir

protected void insertDir(java.lang.String name)
Inserts a directory into this tree.

Parameters:
name - directory to insert

getDirectoryPrefix

protected java.lang.String getDirectoryPrefix(java.lang.String path)
Returns the prefix of a given directory string. The result is a string with all characters until CvsFile.PATH_DELIMITER is reached. CvsFile.PATH_DELIMITER is included as the last character in the result.

Parameters:
path - to use
Returns:
The path prefix

getDirectorySuffix

protected java.lang.String getDirectorySuffix(java.lang.String path)
Returns the suffix of a given directory string. The result is a string with all characters from the first CvsFile.PATH_DELIMITER until the end. CvsFile.PATH_DELIMITER is is not included as the first character.

Parameters:
path - path to use
Returns:
The path suffix

iterator

public CvsTreeIterator iterator()
Returns an CvsTreeIterator over the elements in this tree.

Returns:
A iterator over this tree.
See Also:
CvsTreeIterator

toString

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

Returns:
A tree string representation