T - Type of object which can be loaded by the LoaderC - Type of object that is cached.public abstract class BinaryLoader<T,C> extends Object implements Loader<T,InputStream>
BinaryLoader is
able to read an Object from an InputStream. Technically,
this could also read a text-file, but in this case the AsciiFileLoader
is better suited.
The cached object should be a data object, otherwise the ResourceLoader
would turn into a singelton container. Caching is still handled in the ResourceLoader| Constructor and Description |
|---|
BinaryLoader() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cache(C cache)
Caches the value.
|
abstract T |
fromCache(C value)
This method should construct the object from a cached
value provided by the ResourceLoader
|
C |
getCache()
Returns a generated cache item.
|
abstract Class<C> |
getCacheType()
Returns the Type of the Cache data.
|
public abstract T fromCache(C value) throws Exception
value - CacheExceptionpublic abstract Class<C> getCacheType()
public C getCache()
Loader.get()protected void cache(C cache)
Loader.get()cache - value to cacheCopyright © 2014. All rights reserved.