Class File

java.lang.Object
  extended byFile
Direct Known Subclasses:
Directory

public class File
extends java.lang.Object

A File represents an operating system structure that is used to access the contents of a file.

In this simulation, files have no content so there are no methods for accessing the file contents.


Field Summary
private  int fileNumber
          fileNumber is the file number for this file.
static int NULL
          File.NULL is the file number for nonexistent files.
 
Constructor Summary
File()
          new File() returns a new file.
 
Method Summary
static int fileNumber(java.lang.Integer fn)
          File.fileNumber(fn) returns an int file number for the Integer fn.
 int getFileNumber()
          f.getFileNumber() returns the file number of f.
 boolean isDirectory()
          f.isDirectory() returns true if f is a directory.
 void setFileNumber(int fn)
          f.setFileNumber(fn) sets the file number of f to fn.
 java.lang.String toString()
          f.toString() returns the class name and file number of f as a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final int NULL
File.NULL is the file number for nonexistent files.

See Also:
Constant Field Values

fileNumber

private int fileNumber
fileNumber is the file number for this file.

Constructor Detail

File

public File()
new File() returns a new file.

Method Detail

isDirectory

public boolean isDirectory()
f.isDirectory() returns true if f is a directory.


getFileNumber

public int getFileNumber()
f.getFileNumber() returns the file number of f.


setFileNumber

public void setFileNumber(int fn)
f.setFileNumber(fn) sets the file number of f to fn.


toString

public java.lang.String toString()
f.toString() returns the class name and file number of f as a string.


fileNumber

public static int fileNumber(java.lang.Integer fn)
File.fileNumber(fn) returns an int file number for the Integer fn. If fn is null then File.NULL is returned.