kiwi.util
Class DirectoryPath

java.lang.Object
  |
  +--kiwi.util.DirectoryPath

public class DirectoryPath
extends Object

A convenience class for maintaining a directory path (that is, an ordered list of directories).

Version:
1.1 (11/98)
Author:
Mark Lindner, PING Software Group

Constructor Summary
DirectoryPath()
          Construct a new, empty DirectoryPath.
DirectoryPath(String[] dirs)
          Construct a new DirectoryPath for the given directories.
 
Method Summary
 void append(String dir)
          Append a directory to the end of the path.
 void append(String[] dirs)
          Append a list directories to the end of the path.
 String[] getDirectories()
          Get the list of directories for this path.
 void prepend(String dir)
          Prepend a directory to the beginning of the path.
 void prepend(String[] dirs)
          Prepend a list directories to the beginning of the path.
 String toString()
          Convert this path to a string, using the appropriate path separator for this platform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DirectoryPath

public DirectoryPath()
Construct a new, empty DirectoryPath.

DirectoryPath

public DirectoryPath(String[] dirs)
Construct a new DirectoryPath for the given directories.
Parameters:
dirs - An array of directory names.
Method Detail

prepend

public void prepend(String dir)
Prepend a directory to the beginning of the path.
Parameters:
dir - The directory to add.

prepend

public void prepend(String[] dirs)
Prepend a list directories to the beginning of the path. The order of the directories is preserved.
Parameters:
dirs - The directories to add.

append

public void append(String dir)
Append a directory to the end of the path.
Parameters:
dir - The directory to add.

append

public void append(String[] dirs)
Append a list directories to the end of the path. The order of the directories is preserved.
Parameters:
dirs - The directories to add.

getDirectories

public String[] getDirectories()
Get the list of directories for this path.
Returns:
An array of directory names.

toString

public String toString()
Convert this path to a string, using the appropriate path separator for this platform.
Overrides:
toString in class Object