net.sf.freecol.common.resources
Class ResourceMapping

java.lang.Object
  extended by net.sf.freecol.common.resources.ResourceMapping

public class ResourceMapping
extends java.lang.Object

Represents a mapping between IDs and resources.

See Also:
Resource

Field Summary
protected  java.util.Map<java.lang.String,Resource> resources
          Mappings between an ID and a resource.
 
Constructor Summary
ResourceMapping()
          Creates a new empty ResourceMapping.
 
Method Summary
 void add(java.lang.String id, Resource value)
          Adds a mapping between the given ID and a Resource.
 void addAll(ResourceMapping rc)
          Adds all mappings from the given ResourceMapping to this object.
 boolean containsKey(java.lang.String key)
           
 Resource get(java.lang.String id)
          Gets the Resource identified by the given id.
 java.util.Map<java.lang.String,Resource> getResources()
          Returns all the mappings between IDs and Resources that are kept by this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resources

protected java.util.Map<java.lang.String,Resource> resources
Mappings between an ID and a resource.

Constructor Detail

ResourceMapping

public ResourceMapping()
Creates a new empty ResourceMapping.

Method Detail

add

public void add(java.lang.String id,
                Resource value)
Adds a mapping between the given ID and a Resource.

Parameters:
id - The ID identifying the given resource in the mapping.
value - The Resource identified by the ID in the mapping,.

addAll

public void addAll(ResourceMapping rc)
Adds all mappings from the given ResourceMapping to this object.

Parameters:
rc - The ResourceMapping.

containsKey

public boolean containsKey(java.lang.String key)

getResources

public java.util.Map<java.lang.String,Resource> getResources()
Returns all the mappings between IDs and Resources that are kept by this object.

Returns:
An unmodifiable Map.

get

public Resource get(java.lang.String id)
Gets the Resource identified by the given id.

Parameters:
id - The ID.
Returns:
The Resource.