org.jboss.webbeans.contexts
Class SimpleBeanMap

java.lang.Object
  extended by com.google.common.collect.ForwardingObject
      extended by com.google.common.collect.ForwardingMap<Contextual<? extends java.lang.Object>,java.lang.Object>
          extended by org.jboss.webbeans.contexts.SimpleBeanMap
All Implemented Interfaces:
java.util.Map<Contextual<? extends java.lang.Object>,java.lang.Object>, BeanMap

public class SimpleBeanMap
extends com.google.common.collect.ForwardingMap<Contextual<? extends java.lang.Object>,java.lang.Object>
implements BeanMap

A BeanMap that uses a simple forwarding HashMap as backing map

Author:
Nicklas Karlsson

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Field Summary
protected  java.util.Map<Contextual<? extends java.lang.Object>,java.lang.Object> delegate
           
 
Constructor Summary
SimpleBeanMap()
          Constructor
 
Method Summary
 void clear()
          Clears the map
 java.util.Map<Contextual<? extends java.lang.Object>,java.lang.Object> delegate()
          Gets the delegate for the map
<T> T
get(Contextual<? extends T> bean)
          Gets an instance from the map
 java.util.Set<Contextual<? extends java.lang.Object>> keySet()
          Returns the beans contained in the map
<T> void
put(Contextual<? extends T> bean, T instance)
          Puts a bean instance under the bean key in the map
<T> T
remove(Contextual<? extends T> bean)
          Removed a instance from the map
 java.lang.String toDetailedString()
           
 java.lang.String toString()
           
 
Methods inherited from class com.google.common.collect.ForwardingMap
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, put, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate

protected java.util.Map<Contextual<? extends java.lang.Object>,java.lang.Object> delegate
Constructor Detail

SimpleBeanMap

public SimpleBeanMap()
Constructor

Method Detail

get

public <T> T get(Contextual<? extends T> bean)
Gets an instance from the map

Specified by:
get in interface BeanMap
Parameters:
The - bean to look for
Returns:
An instance, if found
See Also:
org.jboss.webbeans.contexts.BeanMap#get(Bean)

delegate

public java.util.Map<Contextual<? extends java.lang.Object>,java.lang.Object> delegate()
Gets the delegate for the map

Overrides:
delegate in class com.google.common.collect.ForwardingMap<Contextual<? extends java.lang.Object>,java.lang.Object>
Returns:
The delegate

remove

public <T> T remove(Contextual<? extends T> bean)
Removed a instance from the map

Specified by:
remove in interface BeanMap
Parameters:
bean - the bean to remove
Returns:
The instance removed
See Also:
org.jboss.webbeans.contexts.BeanMap#remove(Bean)

clear

public void clear()
Clears the map

Specified by:
clear in interface java.util.Map<Contextual<? extends java.lang.Object>,java.lang.Object>
Specified by:
clear in interface BeanMap
Overrides:
clear in class com.google.common.collect.ForwardingMap<Contextual<? extends java.lang.Object>,java.lang.Object>
See Also:
BeanMap.clear()

keySet

public java.util.Set<Contextual<? extends java.lang.Object>> keySet()
Returns the beans contained in the map

Specified by:
keySet in interface java.util.Map<Contextual<? extends java.lang.Object>,java.lang.Object>
Specified by:
keySet in interface BeanMap
Overrides:
keySet in class com.google.common.collect.ForwardingMap<Contextual<? extends java.lang.Object>,java.lang.Object>
Returns:
The beans present
See Also:
BeanMap.keySet()

put

public <T> void put(Contextual<? extends T> bean,
                    T instance)
Puts a bean instance under the bean key in the map

Specified by:
put in interface BeanMap
Parameters:
bean - The bean
instance - the instance
See Also:
org.jboss.webbeans.contexts.BeanMap#put(Bean, Object)

toString

public java.lang.String toString()
Overrides:
toString in class com.google.common.collect.ForwardingObject

toDetailedString

public java.lang.String toDetailedString()


Copyright © 2008. All Rights Reserved.