// FileList.java public class FileList extends List { // constructor public FileList() { super( "File List" ); } // end constructor // check file name public boolean checkFileName( String name, File f ) { if ( name.equals( f.getFileName() ) ) return true; else return false; } // end method checkFileName // find node in the file representing the file with same name public ListNode findNode( String name ) { ListNode current = null; File file; for( current = getFirstNode(); current != null; current = current.getNext() ) { file = ( File ) current.getObject(); if ( checkFileName( name, file ) ) return current; } return current; } // end method findNode } // end class // ********************************************************************************************* // This method was removed no longer needed /* // search for file public boolean searchFile( String name ) { // look for file name File file; // object used to retrieve file data ListNode current; for( current = getFirstNode(); current != null; current = current.getNext() ) { file = ( File ) current.getObject(); if( checkFileName( name, file ) ) return true; } return false; } // end method searchFile */ // get list position // Method removed no longer needed /*public int getListPosition( String name ) { // look for file name File file; // object used to retrieve file data ListNode current = getFirstNode(); int position = 0; if ( !searchFile( name ) ) System.out.printf( "File not found.\n" ); else while( current != null ) { file = ( File ) current.getObject(); position++; if ( checkFileName( name, file ) ) return position; current = current.getNext(); } return position; } // end method getListPosition */ /*// print saved files only public void printSavedFiles() { ListNode node; // file from current file list File file; // file object in file node Sector sec; node = getFirstNode(); while ( node != null ) { file = ( File ) node.getObject(); if( file.getSaved() == true ) { System.out.printf ( "%10s", file.getFileName() ); System.out.printf ( "%30s", file.printSectorsUsed() ); } // end if node = node.getNext(); } // end while } // end method*/