org.javagen.agile.core.context
Class ContextHolderStack

java.lang.Object
  extended by org.javagen.agile.core.context.ContextHolderStack
All Implemented Interfaces:
Map<String,Object>, Context

public class ContextHolderStack
extends Object
implements Context

Holds a stack of ContextHolders (i.e. Contexts) allowing access as if it was a single context. Keys pushed on the stack will mask prior keys with identical names.

Author:
Richard Easterling

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
protected  Context combinedContext
           
protected  List<ContextHolder> contextHolderStack
           
 
Constructor Summary
ContextHolderStack()
           
 
Method Summary
 void clear()
           
 Context combinedContext()
           
 boolean containsKey(Object key)
           
 boolean containsValue(Object value)
           
 Set<Map.Entry<String,Object>> entrySet()
           
 boolean equals(Object o)
           
 Object get(Object key)
           
 int hashCode()
           
 boolean isEmpty()
           
 Set<String> keySet()
           
 ContextHolder peek()
           
 ContextHolder pop()
           
 ContextHolderStack push(ContextHolder context)
           
 Object put(String key, Object value)
           
 void putAll(Map<? extends String,? extends Object> t)
           
 Object remove(Object key)
           
 int size()
           
 Collection<Object> values()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

contextHolderStack

protected List<ContextHolder> contextHolderStack

combinedContext

protected Context combinedContext
Constructor Detail

ContextHolderStack

public ContextHolderStack()
Method Detail

pop

public ContextHolder pop()

peek

public ContextHolder peek()

push

public ContextHolderStack push(ContextHolder context)

get

public Object get(Object key)
Specified by:
get in interface Map<String,Object>

containsKey

public boolean containsKey(Object key)
Specified by:
containsKey in interface Map<String,Object>

keySet

public Set<String> keySet()
Specified by:
keySet in interface Map<String,Object>

clear

public void clear()
Specified by:
clear in interface Map<String,Object>

containsValue

public boolean containsValue(Object value)
Specified by:
containsValue in interface Map<String,Object>

entrySet

public Set<Map.Entry<String,Object>> entrySet()
Specified by:
entrySet in interface Map<String,Object>

equals

public boolean equals(Object o)
Specified by:
equals in interface Map<String,Object>
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Map<String,Object>
Overrides:
hashCode in class Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<String,Object>

put

public Object put(String key,
                  Object value)
Specified by:
put in interface Map<String,Object>

putAll

public void putAll(Map<? extends String,? extends Object> t)
Specified by:
putAll in interface Map<String,Object>

remove

public Object remove(Object key)
Specified by:
remove in interface Map<String,Object>

size

public int size()
Specified by:
size in interface Map<String,Object>

values

public Collection<Object> values()
Specified by:
values in interface Map<String,Object>

combinedContext

public Context combinedContext()


Copyright 2006-2006-2007 Outsource Cafe Inc.. All Rights Reserved.