com.jme.scene
Class UserDataManager

java.lang.Object
  extended by com.jme.scene.UserDataManager

public class UserDataManager
extends java.lang.Object

UserDataManager maintains a map of objects that are assigned to scene data (Spatials). This data can be any user defined Savable data.

Author:
Mark Powell

Method Summary
 void bind(Spatial key, Spatial original)
           
 void clear()
           
 java.util.HashMap<java.lang.String,Savable> getAllData(Spatial key)
           
static UserDataManager getInstance()
          Obtains the singleton instance of the UserDataManager.
 Savable getUserData(Spatial spatial, java.lang.String key)
          Retrieves a user data object(Savable) using a Spatial key and a finegrained key
 Savable removeUserData(Spatial spatial, java.lang.String key)
          Removed a user data object(Savable) from the map using a Spatial key and a finegrained key
 void setAllData(Spatial key, java.util.HashMap<java.lang.String,Savable> data)
           
 void setUserData(Spatial spatial, java.lang.String key, Savable data)
          Maps a Spatial and a key to user data(a Savable)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static UserDataManager getInstance()
Obtains the singleton instance of the UserDataManager.

Returns:
the singleton instance of UserDataManager.

getAllData

public java.util.HashMap<java.lang.String,Savable> getAllData(Spatial key)

setAllData

public void setAllData(Spatial key,
                       java.util.HashMap<java.lang.String,Savable> data)

setUserData

public void setUserData(Spatial spatial,
                        java.lang.String key,
                        Savable data)
Maps a Spatial and a key to user data(a Savable)

Parameters:
spatial - Main key used in mapping
key - Key for finegrained mapping inside the provided Spatial
data - User data to map against the Spatial and key

getUserData

public Savable getUserData(Spatial spatial,
                           java.lang.String key)
Retrieves a user data object(Savable) using a Spatial key and a finegrained key

Parameters:
spatial - Main key used in mapping
key - Key for finegrained mapping inside the provided Spatial
Returns:
User data object retrieved with the keys provided(or null if not stored)

removeUserData

public Savable removeUserData(Spatial spatial,
                              java.lang.String key)
Removed a user data object(Savable) from the map using a Spatial key and a finegrained key

Parameters:
spatial - Main key used in mapping
key - Key for finegrained mapping inside the provided Spatial
Returns:
User data object removed with the keys provided(or null if not stored)

bind

public void bind(Spatial key,
                 Spatial original)

clear

public void clear()