Class URLHandler<T>

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

public abstract class URLHandler<T> extends Object implements ResourceHandler<T>
Load resources from URLs.
  • Constructor Details

    • URLHandler

      public URLHandler()
      Constructor
    • URLHandler

      public URLHandler(List<URL> urls)
      Constructor
      Parameters:
      urls - initial list of URLs to load
  • Method Details

    • add

      public void add(URL url)
      Add the given url to the handler.
      Parameters:
      url -
    • remove

      public void remove(URL url)
      Remove the given url from the loader
    • getURLS

      public List<URL> getURLS()
      Live list to the URLs loaded by this handler.
      Returns:
      the list of urls
    • loadFromURL

      public abstract T loadFromURL(URL url) throws IOException
      Instantiate the object from the given url.
      Parameters:
      url -
      Throws:
      IOException
    • 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