Package ca.phon.util.resources
Class URLHandler<T>
java.lang.Object
ca.phon.util.resources.URLHandler<T>
- All Implemented Interfaces:
ResourceHandler<T>
,Iterable<T>
- Direct Known Subclasses:
ClassLoaderHandler
Load resources from URLs.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the given url to the handler.getURLS()
Live list to theURL
s loaded by this handler.iterator()
Return an iterator for instances of type T.abstract T
loadFromURL
(URL url) Instantiate the object from the given url.void
Remove the given url from the loaderMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
URLHandler
public URLHandler()Constructor -
URLHandler
Constructor- Parameters:
urls
- initial list of URLs to load
-
-
Method Details
-
add
Add the given url to the handler.- Parameters:
url
-
-
remove
Remove the given url from the loader -
getURLS
Live list to theURL
s loaded by this handler.- Returns:
- the list of urls
-
loadFromURL
Instantiate the object from the given url.- Parameters:
url
-- Throws:
IOException
-
iterator
Description copied from interface:ResourceHandler
Return an iterator for instances of type T.
-