ccs.utils
Class PathTokenizer

java.lang.Object
  extended by ccs.utils.PathTokenizer

public class PathTokenizer
extends java.lang.Object

A specialised version of a StringTokenizer, primarily for use when parsing paths.


Constructor Summary
PathTokenizer(java.lang.String path, char delim, boolean isDelimTrail)
          A PathTokenizer.
 
Method Summary
 java.lang.String next()
          Return the next token.
 java.lang.String tail()
          Return the rest of the path without parsing it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PathTokenizer

public PathTokenizer(java.lang.String path,
                     char delim,
                     boolean isDelimTrail)
A PathTokenizer.

Parameters:
path - The path to tokenize. It may start either with a delimiter, or some prefix.
delim - The delimiter character. Generally either '/' or '\\'.
isDelimTrail - If false, path elements start with a delimiter (except for the path prefix if any. If true, path elements end with a delimiter (except the last, sometimes).
Method Detail

next

public java.lang.String next()
Return the next token.

Returns:
The token. Null if all tokens have been returned.

tail

public java.lang.String tail()
Return the rest of the path without parsing it. Null if nothing left.