com.google.gwt.core.client.impl
Class WeakMapping

java.lang.Object
  extended by com.google.gwt.core.client.impl.WeakMapping

public class WeakMapping
extends java.lang.Object

A class associating a (String, Object) map with arbitrary source objects (except for Strings). This implementation is used in hosted mode.


Constructor Summary
WeakMapping()
           
 
Method Summary
static java.lang.Object get(java.lang.Object instance, java.lang.String key)
          Returns the Object associated with the given key in the (key, value) mapping associated with the given Object instance.
static void set(java.lang.Object instance, java.lang.String key, java.lang.Object value)
          Associates a value with a given key in the (key, value) mapping associated with the given Object instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WeakMapping

public WeakMapping()
Method Detail

get

public static java.lang.Object get(java.lang.Object instance,
                                   java.lang.String key)
Returns the Object associated with the given key in the (key, value) mapping associated with the given Object instance.

Parameters:
instance - the source Object.
key - a String key.
Returns:
an Object associated with that key on the given instance, or null.

set

public static void set(java.lang.Object instance,
                       java.lang.String key,
                       java.lang.Object value)
Associates a value with a given key in the (key, value) mapping associated with the given Object instance. Note that the key space is module-wide, so some care should be taken to choose sufficiently unique identifiers.

Due to restrictions of the web mode implementation, the instance argument must not be a String.

Parameters:
instance - the source Object, which must not be a String.
key - a String key.
value - the Object to associate with the key on the given source Object.
Throws:
java.lang.IllegalArgumentException - if instance is a String.