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

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.
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

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.