net.sf.freecol.common.resources
Class Resource

java.lang.Object
  extended by net.sf.freecol.common.resources.Resource
Direct Known Subclasses:
AudioResource, ChipResource, ColorResource, FAFileResource, FontResource, ImageResource, SZAResource, VideoResource

public abstract class Resource
extends java.lang.Object

Represents a resource that either has been or can be loaded using a URI. There can only be one instance of Resource having the same (as in URI's equals, not the identity) URI. Instances are created using ResourceFactory.createResource(URI).


Field Summary
private  java.net.URI resourceLocator
          The URI used when loading this resource.
 
Constructor Summary
protected Resource()
           
(package private) Resource(java.net.URI resourceLocator)
          Do not use directly.
 
Method Summary
 java.net.URI getResourceLocator()
          Returns the URI used for loading the resource.
abstract  void preload()
          Preload the resource.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceLocator

private final java.net.URI resourceLocator
The URI used when loading this resource.

Constructor Detail

Resource

protected Resource()

Resource

Resource(java.net.URI resourceLocator)
Do not use directly.

Parameters:
resourceLocator - The URI used when loading this resource.
See Also:
ResourceFactory.createResource(URI)
Method Detail

preload

public abstract void preload()
Preload the resource. Often implemented as a noop.


getResourceLocator

public java.net.URI getResourceLocator()
Returns the URI used for loading the resource.

Returns:
The URI.