/** * FileNode.java * * @author Mr J * @version 20050210 */ class FileNode { // This could be used to hold a key and an address in a Random Access File // For SL, if using text files, it could contain a position/line in the text file // It could also be used to access data stored in an array by storing the element number private String name; private long filePos; private FileNode next; public FileNode( ) { // default constructor, sets fields to null name = null; filePos = -1; next = null; } public FileNode(String nm, long fp, FileNode nx ) { // Second Constructor for a student record, assigns fields setName(nm); setFilePos(fp); setNext(nx); } // accessor methods public String getName() {return name;} public FileNode getNext(){ return next;} public long getFilePos(){return filePos;} // modifier methods public void setName( String nm ) {name = nm;} public void setNext( FileNode n){next = n;} public void setFilePos( long fp ){filePos = fp;} }