public class

WeakMapping

extends Object
java.lang.Object
   ↳ com.google.gwt.core.client.impl.WeakMapping

Class Overview

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

Summary

Public Constructors
WeakMapping()
Public Methods
synchronized static Object get(Object instance, String key)
Returns the Object associated with the given key in the (key, value) mapping associated with the given Object instance.
synchronized static void set(Object instance, String key, Object value)
Associates a value with a given key in the (key, value) mapping associated with the given Object instance.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public WeakMapping ()

Public Methods

public static synchronized Object get (Object instance, 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.

public static synchronized void set (Object instance, String key, 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 Production 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
IllegalArgumentException if instance is a String.