|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
Object
Store
public class Store
This class is a Widget specific persistent storage. Store is like a hashtable - it supports getting, putting, removing and listing of elements. Elements may be stored or retrieved in three different formats: ByteArray, Value or Streams. Note that format information is not stored along with content, meaning that code must read and write information using the same format.
ByteArray,
Value,
InputStream,
OutputStream| Method Summary | |
|---|---|
ByteArray |
get(String name)
Returns the named element as ByteArray. |
int |
getSize()
Returns the amount of space, in bytes, that the store occupies. |
InputStream |
getStream(String name)
Returns the named element as InputStream. |
Value |
getValue(String name)
Returns the named element as Value. |
boolean |
has(String name)
Checks if the store has a named element. |
List |
list()
Returns a list containing the names of all stored elements. |
void |
put(String name,
ByteArray array)
Sets an element to Store. |
void |
put(String name,
OutputStream output)
Sets an element to Store. |
void |
put(String name,
Value value)
Sets an element to Store. |
void |
remove(String name)
Removes named element from Store. |
| Methods inherited from class Object |
|---|
toString, equals, hashCode |
| Methods inherited from |
|---|
equals, getClass, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public List list()
public ByteArray get(String name)
name - Name of element to retrieve
null if the store
does not contain named elements.public Value getValue(String name)
name - Name of element to retrieve
null if the store
does not contain named elements.public InputStream getStream(String name)
name - Name of element to retrieve
null if the store
does not contain named elements.public boolean has(String name)
name - Name of element to check for
true if the element exists, false otherwise.
public void put(String name,
ByteArray array)
name - Name of element to retrievearray - Content of element
public void put(String name,
Value value)
name - Name of element to retrievevalue - Content of element
public void put(String name,
OutputStream output)
name - Name of element to retrieveoutput - Content of elementpublic void remove(String name)
name - Name of element to removepublic int getSize()
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||