public class AssetList
extends java.lang.Object
Constructor and Description |
---|
AssetList(java.lang.String name,
int capacity) |
Modifier and Type | Method and Description |
---|---|
int |
add(java.lang.String key,
long[] meta,
java.lang.Object obj)
It checks object and the existence of the key first.
|
int |
add(java.lang.String key,
long[] meta,
java.lang.Object obj,
int id)
It checks object and the existence of the key first.
|
Browser |
browser()
returns a Browser for all IDs in the natural order
|
void |
clear() |
boolean |
containsKey(java.lang.String key)
returns true if the the list contains the key
|
boolean |
existsID(int id)
returns true if the assset for the id exists
|
protected void |
finalize() |
java.lang.Object |
get(int id)
returns the object of the key
|
java.lang.Object |
get(java.lang.String key)
returns the object of the key
|
int |
getCapacity() |
int |
getID(java.lang.String key)
returns the id of the object on the key or null if no object on the key
|
java.lang.String |
getKey(int id)
returns the key of the id or null if no object at the id
|
long[] |
getMetaData(int id)
returns the metadata for the object of id
|
long[] |
getMetaData(java.lang.String key)
returns the metadata for the object referenced by the key
|
java.lang.String |
getName() |
int |
insert(java.lang.String key,
long[] meta,
java.lang.Object obj,
int id)
It checks the object and the existence of the key first.
|
boolean |
isFull() |
int |
queryIDs(int[] ids)
returns number of assets after loading the ids to the buffer in natural
order
|
java.lang.Object |
remove(int id)
removes both the object of the id and its metadata.
|
java.lang.Object |
remove(java.lang.String key)
removes both the object of the key and its metadata.
|
java.lang.String |
replaceKey(int id,
java.lang.String key)
replaces the key of the id and returns the original key upon success.
|
int |
rotate(int id)
rotates the object with the id and its metadata to the end of the list
and returns 1 for success, 0 for failure or -1 for out of bound.
|
java.lang.Object |
set(int id,
java.lang.Object obj)
It checks the id first.
|
java.lang.Object |
set(java.lang.String key,
java.lang.Object obj)
It checks the object and the existence of the key first.
|
int |
size() |
int |
swap(int id,
int jd)
swaps two objects and their metadata identified by id and jd
and returns 1 for success, 0 for failure or -1 for out of bound.
|
public int size()
public java.lang.String getName()
public int getCapacity()
public int add(java.lang.String key, long[] meta, java.lang.Object obj)
public int add(java.lang.String key, long[] meta, java.lang.Object obj, int id)
public int insert(java.lang.String key, long[] meta, java.lang.Object obj, int id)
public int swap(int id, int jd)
public int rotate(int id)
public java.lang.Object set(int id, java.lang.Object obj)
public java.lang.Object set(java.lang.String key, java.lang.Object obj)
public int getID(java.lang.String key)
public java.lang.String getKey(int id)
public java.lang.String replaceKey(int id, java.lang.String key)
public java.lang.Object get(int id)
public java.lang.Object get(java.lang.String key)
public java.lang.Object remove(java.lang.String key)
public java.lang.Object remove(int id)
public boolean containsKey(java.lang.String key)
public boolean existsID(int id)
public long[] getMetaData(java.lang.String key)
public long[] getMetaData(int id)
public int queryIDs(int[] ids)
public boolean isFull()
public Browser browser()
public void clear()
protected void finalize()
finalize
in class java.lang.Object