Class: ResourceManager

Resources.ResourceManager

new Resources.ResourceManager ()

The resource manager. Handles URL resources as well as objects.

Methods

add (key, resource)Boolean

add resource with key
Name Type Description
key object key to the resource
resource object the resource object
Returns:
Type Description
Boolean true if saved, false otherwise.

get (key)object

get resource by key
Name Type Description
key object key to resource
Returns:
Type Description
object the resource desired or null if not found

getClone (key)object

get resource clone by key (CANT BE SELF-REFERENCING!)
Name Type Description
key object key to resource
Returns:
Type Description
object copy of the resource or null if not found

getResourceName (resource)

get resource name by resource object
Name Type Description
resource object resource data (URL or object/blob)

remove (key)Boolean

remove resource
Name Type Description
key object key to resource to remove.
Returns:
Type Description
Boolean true if removed; false otherwise.

removeByValue (resource)Boolean

removes resource by resource object.
Name Type Description
resource object the resource object to remove
Returns:
Type Description
Boolean true if removed; false otherwise.