|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for object databases
Object databases in Omegahat extend the concept of
hash-table databases in Java (e.g.,
)
Additional concepts include the notion of attaching/detaching the
database from the Omegahat interactive session, the use
of listeners to detect events on the database, and a more general
attitude to what can be assigned.
| Field Summary | |
static int |
ALL
|
static int |
ASSIGN
|
static int |
ATTACH
|
static int |
DETACH
This and following fields, down through ALL are used to identify event types for listeners. |
static java.lang.String |
NULL_ENTRY
the constant object stored to correspond to a null assignment. |
static int |
READ
|
static int |
READ_WRITE
database access constants, thinking about a multi-user system. |
static int |
REMOVE
|
| Fields inherited from interface org.omegahat.Environment.Databases.Activable |
ACTIVE, INACTIVE |
| Method Summary | |
boolean |
assign(java.lang.String name,
java.lang.Object obj)
assigns obj to the database under name. |
boolean |
attach(DatabaseCustomer e)
|
void |
clear()
remove all the objects from the database. |
boolean |
detach(DatabaseCustomer e)
|
boolean |
exists(java.lang.String name)
does the object exist in the database? |
java.lang.Object |
get(java.lang.String name)
returns the object in the database assigned under the name. |
java.lang.String |
getName()
|
java.lang.String[] |
objects()
the array of object names. |
java.lang.Object |
remove(java.lang.String name)
remove the object from the database |
java.lang.String |
setName(java.lang.String name)
|
int |
size()
what is the size (in bytes?) of the database. |
| Methods inherited from interface org.omegahat.Environment.Databases.Activable |
getState, setState |
| Field Detail |
public static final int DETACH
ALL are used to identify event types for listeners.public static final int ATTACH
public static final int ASSIGN
public static final int REMOVE
public static final int ALL
public static final int READ_WRITE
public static final int READ
public static final java.lang.String NULL_ENTRY
null assignment.| Method Detail |
public java.lang.String[] objects()
public java.lang.Object get(java.lang.String name)
null if none.
public boolean assign(java.lang.String name,
java.lang.Object obj)
throws java.lang.Exception
obj to the database under name.obj - any object, including nullname - a string (preferably non-empty) to locate the object in
the database.public java.lang.Object remove(java.lang.String name)
name - any string, matching the one used in a previous
assignment.public boolean exists(java.lang.String name)
public void clear()
public int size()
public boolean detach(DatabaseCustomer e)
public boolean attach(DatabaseCustomer e)
public java.lang.String getName()
public java.lang.String setName(java.lang.String name)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||