Package Torello.Java

Interface IOExceptionHandler

  • All Superinterfaces:
    java.util.function.BiConsumer<FileNode,​java.io.IOException>, java.io.Serializable

    public interface IOExceptionHandler
    extends java.util.function.BiConsumer<FileNode,​java.io.IOException>, java.io.Serializable
    A functional-interface, used in case of IOException, to be used alongside the 'GREP' Tool.

    This class is just intended to handle {@code IOException's}, and perform User-Defined actions when a GREP fails for a particular file. The primary value of this interface is that users can handle exceptions without halting the entire {@code GREP} method for the rest of the files merely because of a failure with a single file.


    • Method Summary

       
      @FunctionalInterface: (Lambda) Method
      Modifier and Type Method
      void accept​(FileNode fn, IOException e)
      • Methods inherited from interface java.util.function.BiConsumer

        andThen
    • Field Detail

      • serialVersionUID

        🡇     🗕  🗗  🗖
        static final long serialVersionUID
        This fulfils the SerialVersion UID requirement for all classes that implement Java's interface java.io.Serializable. Using the Serializable Implementation offered by java is very easy, and can make saving program state when debugging a lot easier. It can also be used in place of more complicated systems like "hibernate" to store data as well.

        Functional Interfaces are usually not thought of as Data Objects that need to be saved, stored and retrieved; however, having the ability to store intermediate results along with the lambda-functions that helped get those results can make debugging easier.
        See Also:
        Constant Field Values
        Code:
        Exact Field Declaration Expression:
         public static final long serialVersionUID = 1;
        
      • SIMPLE

        🡅  🡇     🗕  🗗  🗖
        static final IOExceptionHandler SIMPLE
        Unless a more advanced behavior is expected, this IOException handler should suffice for most of the routines in the GREP and the FileNode classes. It simply prints the standard IOException stack trace to the standard System out.
    • Method Detail

      • accept

        🡅     🗕  🗗  🗖
        void accept​(FileNode fn,
                    java.io.IOException e)
        FunctionalInterface Target-Method:
        This method corresponds to the @FunctionalInterface Annotation's method requirement. It is the only non-default, non-static method in this interface, and may be the target of a Lambda-Expression or '::' (double-colon) Function-Pointer.
        Specified by:
        accept in interface java.util.function.BiConsumer<FileNode,​java.io.IOException>
        Parameters:
        fn - This may be any FileNode
        e - This exception is passed indicating that an IOException occurred when attempting to search or 'GREP' through this file. The programmer may do or perform any type of exception handling needed.