1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | package Torello.Java; import java.util.function.BiConsumer; import java.io.IOException; /** * A functional-interface, used in case of <CODE>IOException</CODE>, to be used alongside the * <CODE>'GREP'</CODE> Tool. * * <BR /><BR /><EMBED CLASS="external-html" DATA-FILE-ID="IOEH"> */ public interface IOExceptionHandler extends BiConsumer<FileNode, IOException>, java.io.Serializable { /** <EMBED CLASS="external-html" DATA-FILE-ID="SVUIDFI"> */ public static final long serialVersionUID = 1; /** * <B><SPAN STYLE="color: red;">FUNCTIONAL-INTERFACE BOOLEAN METHOD:</SPAN></B> This is the * method that fulfils this {@code functional-interface 'test'} method. * * @param fn This may be any FileNode * * @param e This exception is passed indicating that an {@code IOException} occurred when * attempting to search or {@code 'GREP'} through this file. The programmer may do or perform * any type of exception handling needed. */ public void accept(FileNode fn, IOException e); /** * Unless a more advanced behavior is expected, this {@code IOException} handler should suffice * for most of the routines in the {@code GREP} and the {@code FileNode} classes. It simply * prints the standard {@code IOException} stack trace to the standard {@code System out}. */ public static IOExceptionHandler SIMPLE = (FileNode fn, IOException e) -> { System.out.println("File: " + fn.toString() + "\tFAILED TO LOAD\n" + e.toString()); }; } |