|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFile
Directory
A Directory represents an operating system structure that is used to access the contents of a directory.
Field Summary | |
private java.util.Map |
entries
entries is the table of directory entries for this directory. |
static char |
SEPARATOR
Directory.SEPARATOR is the direcory separator character in file paths. |
Fields inherited from class File |
NULL |
Constructor Summary | |
Directory()
new Directory() returns a new empty directory. |
Method Summary | |
java.util.Iterator |
entries()
d.entries() returns an iterator for the directory entries in d, excluding the entries for "." and "..". |
int |
getFileNumber(java.lang.String nm)
d.getFileNumber(nm) returns the file number in d whose simple name is nm, or File.NULL if there is no such file. |
boolean |
isDirectory()
d.isDirectory() returns true if f is a directory. |
static boolean |
isSimpleName(java.lang.String nm)
Directory.isSimpleName(nm) returns true if nm is a valid simple file name. |
int |
link(java.lang.String nm,
int fn)
d.link(nm, fn) links fn into d with simple name nm and returns the file number that was previously linked with name nm. |
static void |
main(java.lang.String[] args)
main(args) is a program to test the Directory class. |
int |
size()
d.size() returns the number of directory entries in d, excluding the entries for "." and "..". |
int |
unlink(java.lang.String nm)
d.unlink(nm) unlinks the file whose simple name is nm from d and returns the file. |
Methods inherited from class File |
fileNumber, getFileNumber, setFileNumber, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final char SEPARATOR
private java.util.Map entries
Constructor Detail |
public Directory()
Method Detail |
public boolean isDirectory()
isDirectory
in class File
public int link(java.lang.String nm, int fn)
public int getFileNumber(java.lang.String nm)
public int unlink(java.lang.String nm)
public java.util.Iterator entries()
public int size()
public static boolean isSimpleName(java.lang.String nm)
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |