org.inria.ns.reflex.structures
Class Configurable.Impl

java.lang.Object
  extended by org.inria.ns.reflex.structures.Configurable.Impl
All Implemented Interfaces:
Configurable
Direct Known Subclasses:
SwitchSerializer
Enclosing interface:
Configurable

public static class Configurable.Impl
extends Object
implements Configurable

A base implementation backed by a Map.

Author:
Philippe Poulard

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.inria.ns.reflex.structures.Configurable
Configurable.Impl
 
Constructor Summary
Configurable.Impl()
           
 
Method Summary
 boolean containsAttribute(Object key)
          Returns true if the attributes set contains a mapping for the specified key.
 Object getAttribute(Object key)
          Returns an attribute that has been defined for the processor.
 Map getAttributes()
          Returns the set of attributes defined.
 void mergeAttributes(Map attributes)
          Merges 2 collections.
 void setAttribute(Object key, Object data)
          Defines an attribute.
 void setAttributes(Map attributes)
          Defines an attributes set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Configurable.Impl

public Configurable.Impl()
Method Detail

containsAttribute

public boolean containsAttribute(Object key)
Description copied from interface: Configurable
Returns true if the attributes set contains a mapping for the specified key.

Specified by:
containsAttribute in interface Configurable
Parameters:
key - The key associated to the object.
Returns:
true if the attributes set contains a mapping for the specified key.

getAttribute

public Object getAttribute(Object key)
Description copied from interface: Configurable
Returns an attribute that has been defined for the processor. If none correspond to the key, null is returned.

Specified by:
getAttribute in interface Configurable
Parameters:
key - The key associated to the object.
Returns:
The object defined as an attribute.

getAttributes

public Map getAttributes()
Description copied from interface: Configurable
Returns the set of attributes defined.

Specified by:
getAttributes in interface Configurable
Returns:
The set of attributes defined.

mergeAttributes

public void mergeAttributes(Map attributes)
Description copied from interface: Configurable
Merges 2 collections.

Specified by:
mergeAttributes in interface Configurable
Parameters:
attributes - The attributes set to merge with.

setAttribute

public void setAttribute(Object key,
                         Object data)
Description copied from interface: Configurable
Defines an attribute.

Specified by:
setAttribute in interface Configurable
Parameters:
key - The key associated to the object.
data - The object to define as an attribute.

setAttributes

public void setAttributes(Map attributes)
Description copied from interface: Configurable
Defines an attributes set.

Specified by:
setAttributes in interface Configurable
Parameters:
attributes - The attributes set to define.