new Cache(viewer)
Cache manager for loaded objects.
Parameters:
Name | Type | Description |
---|---|---|
viewer |
FORGE.Viewer | The FORGE.Viewer reference. |
- Source:
Members
(static, constant) types :Object
Const that list different types of cache.
Type:
- Object
- Source:
Methods
add(type, key, file) → {boolean}
Add a file to a specific cache.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | The type of cache you want to use. |
key |
string | The key for the file. |
file |
FORGE.File | The FORGE.File object you want to add. |
- Source:
Returns:
Returns true if the addition is complete, false if not.
- Type
- boolean
destroy()
Destroy sequence.
- Source:
get(type, key) → (nullable) {FORGE.File}
Get the file associated to a key in a specific cache.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | The type of cache you want to use. |
key |
string | The key to search for. |
- Source:
Returns:
Returns the FORGE.File object if found, null if not found.
- Type
- FORGE.File
has(type, key) → {boolean}
Is a cache has something associated to a key?
Parameters:
Name | Type | Description |
---|---|---|
type |
string | The type of cache you want to check. |
key |
string | The key to search for. |
- Source:
Returns:
Returns true if found, false if not.
- Type
- boolean
remove(type, key) → {boolean}
Remove a FORGE.File from a specific cache.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | The type of cache you want to remove the file from. |
key |
string | The key associated to the file you want to remove. |
- Source:
Returns:
Returns true if the deletion is complete, false if not.
- Type
- boolean