Class FileHandler<T>

java.lang.Object
ca.phon.util.resources.FileHandler<T>
All Implemented Interfaces:
ResourceHandler<T>, Iterable<T>
Direct Known Subclasses:
FolderHandler

public abstract class FileHandler<T> extends Object implements ResourceHandler<T>
A library handler which allow for loading a list of explicit files.
  • Constructor Details

    • FileHandler

      public FileHandler()
  • Method Details

    • iterator

      public Iterator<T> iterator()
      Description copied from interface: ResourceHandler
      Return an iterator for instances of type T.
      Specified by:
      iterator in interface Iterable<T>
      Specified by:
      iterator in interface ResourceHandler<T>
      Returns:
      an iterator providing instances of the parameterized type
    • addFile

      public void addFile(File f)
      Add a file to the handler
      Parameters:
      file -
    • removeFile

      public void removeFile(File f)
      Remove a file from the handler
      Parameters:
      file -
    • getFiles

      public List<File> getFiles()
      Live list of the Files loaded by this handler.
      Returns:
      this list of Files
    • loadFromFile

      public abstract T loadFromFile(File f) throws IOException
      Abstract method for loading the given file as an instance of the parameterized type.
      Parameters:
      file -
      Throws:
      IOException