com.sun.tools.javac.file
public static class: RelativePath.RelativeDirectory [javadoc |
source]
java.lang.Object
com.sun.tools.javac.file.RelativePath
com.sun.tools.javac.file.RelativePath$RelativeDirectory
All Implemented Interfaces:
Comparable
Used to represent a platform-neutral subdirectory within a platform-specific
container, such as a directory or zip file.
Internally, the file separator is always '/', and if the path is not empty,
it always ends in a '/' as well.
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from com.sun.tools.javac.file.RelativePath$RelativeDirectory Detail: |
public String basename() {
int l = path.length();
if (l == 0)
return path;
int sep = path.lastIndexOf('/', l - 2);
return path.substring(sep + 1, l - 1);
}
|
boolean contains(RelativePath other) {
return other.path.length() > path.length() && other.path.startsWith(path);
}
Return true if this subdirectory "contains" the other path.
A subdirectory path does not contain itself. |
public RelativeDirectory dirname() {
int l = path.length();
if (l == 0)
return this;
int sep = path.lastIndexOf('/', l - 2);
return new RelativeDirectory(path.substring(0, sep + 1));
}
|
static RelativeDirectory forPackage(CharSequence packageName) {
return new RelativeDirectory(packageName.toString().replace('.', '/'));
}
|
public String toString() {
return "RelativeDirectory[" + path + "]";
}
|