|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnz.ac.waikato.mcennis.rat.graph.model.ModelShell
nz.ac.waikato.mcennis.rat.graph.actor.DBActor
public class DBActor
Class that implemnts an actor backed by a DerbyDB database. Fixes problems of inconsistencies between the database and the in-memory data when using BasicUser class.
| Field Summary |
|---|
| Fields inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
|---|
listener |
| Constructor Summary | |
|---|---|
DBActor()
Creates a new instance of DerbyActor |
|
| Method Summary | |
|---|---|
void |
add(Page page)
FIXME: Not implemented yet. |
void |
add(Property prop)
Add the given property to this user. |
protected int |
comparePages(Actor right)
Compare pages of this actor with the given actor. |
protected int |
compareProperties(Actor right)
Compare properties of this actor with the given actor. |
int |
compareTo(java.lang.Object o)
Throws ClassCastException when the parameter is not an Actor. |
Actor |
duplicate()
Return a copy of this Actor that is equal by compareTo() |
java.lang.String |
getID()
Return the id (unique within its type) |
protected void |
getNumericalID()
Get thye numerical ID that uniquely describes this Actor in the database |
Page[] |
getPage()
FIXME: Not implemented yet. |
Page |
getPage(java.lang.String ID)
FIXME: Not implemented yet. |
Property[] |
getProperty()
Return an array of all properties associated with this actor. |
Property |
getProperty(java.lang.String ID)
Return the property with the given value. |
java.lang.String |
getType()
Returns the type (mode) of this actor |
static void |
init()
static initialization method that sets up the global connection objects. |
static boolean |
isInitialized()
Has this object been Initialized yet. |
void |
publishChange(Model m,
int type,
int argument)
Saves to database the changes in a property. |
void |
removeProperty(java.lang.String ID)
Remove a given property from this actor |
static void |
setDatabase(java.lang.String db)
Set which database to access |
static void |
setDirectory(java.lang.String dir)
Set the location of the Derby database directory |
void |
setID(java.lang.String id)
Sets an id unique (which must be its type). |
void |
setType(java.lang.String type)
Set the type (mode) of this actor. |
| Methods inherited from class nz.ac.waikato.mcennis.rat.graph.model.ModelShell |
|---|
addListener, fireChange |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface nz.ac.waikato.mcennis.rat.graph.actor.Actor |
|---|
equals |
| Constructor Detail |
|---|
public DBActor()
| Method Detail |
|---|
public static void init()
public static boolean isInitialized()
public java.lang.String getID()
Actor
getID in interface Actorpublic void setID(java.lang.String id)
Actor
setID in interface Actorid - ID this actor should be set topublic Property[] getProperty()
Actor
getProperty in interface Actorpublic Property getProperty(java.lang.String ID)
Actor
getProperty in interface ActorID - key-name for the property.
public void removeProperty(java.lang.String ID)
Actor
removeProperty in interface ActorID - key-name of property to remove.public void add(Property prop)
Actor
add in interface Actorprop - property to be addedpublic Page[] getPage()
getPage in interface Actorpublic Page getPage(java.lang.String ID)
getPage in interface ActorID - id of the page to be returned
public void add(Page page)
add in interface Actorpage - Page to be added.public void setType(java.lang.String type)
Actor
setType in interface Actortype - new type (mode) of this actorpublic java.lang.String getType()
Actor
getType in interface Actorpublic Actor duplicate()
Actor
duplicate in interface Actorpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparableprotected int comparePages(Actor right)
right - actor to be compared against
protected int compareProperties(Actor right)
right - actor to be compared against
protected void getNumericalID()
public static void setDirectory(java.lang.String dir)
dir - directory where thye datbases are storedpublic static void setDatabase(java.lang.String db)
db - name of the datbase to open
public void publishChange(Model m,
int type,
int argument)
publishChange in interface Listenerm - Property that changedtype - currently only 0 (Changed) is fired
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||