net.sourceforge.scopes.impl
Class ContextImpl

java.lang.Object
  extended by net.sourceforge.scopes.impl.ContextImpl
All Implemented Interfaces:
Context
Direct Known Subclasses:
ClickScopeManager.ClickContext

public class ContextImpl
extends java.lang.Object
implements Context

Simple implementation for a context.


Field Summary
protected  java.util.Map<java.lang.String,java.lang.Object> name2attribute
          Simple map to store the attributes of the context.
 
Constructor Summary
ContextImpl()
          Constructor.
 
Method Summary
 java.lang.Object getAttribute(java.lang.String name)
          Returns a stored attribute.
 java.util.Set<java.lang.String> getAttributeNames()
          Returns a set of attribute names.
 void removeAttribute(java.lang.String name)
          Removes an attribute.
 void setAttribute(java.lang.String name, java.lang.Object object)
          Sets an attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name2attribute

protected java.util.Map<java.lang.String,java.lang.Object> name2attribute
Simple map to store the attributes of the context.

Constructor Detail

ContextImpl

public ContextImpl()
Constructor.

Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Description copied from interface: Context
Returns a stored attribute.

Specified by:
getAttribute in interface Context
Parameters:
name - The name of the attribute.
Returns:
The needed attribute.

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
Description copied from interface: Context
Returns a set of attribute names.

Specified by:
getAttributeNames in interface Context
Returns:
The set of attribute names.

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object object)
Description copied from interface: Context
Sets an attribute.

Specified by:
setAttribute in interface Context
Parameters:
name - The name of the attribute.
object - The attribute.

removeAttribute

public void removeAttribute(java.lang.String name)
Description copied from interface: Context
Removes an attribute.

Specified by:
removeAttribute in interface Context
Parameters:
name - The attribute to remove.