|
|||||||||
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(Property prop)
Add the given property to this user. |
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. |
java.lang.String |
getID()
Return the id (unique within its type) |
java.lang.String |
getMode()
Returns the type (mode) of this actor |
protected void |
getNumericalID()
Get thye numerical ID that uniquely describes this Actor in the database |
java.util.List<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. |
static void |
init()
static initialization method that sets up the global connection objects. |
void |
init(Properties properties)
|
static boolean |
isInitialized()
Has this object been Initialized yet. |
DBActor |
prototype()
Return a copy of this Actor that is equal by compareTo() |
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 |
setMode(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 Actor
public void setID(java.lang.String id)
Actor
setID
in interface Actor
id
- ID this actor should be set topublic java.util.List<Property> getProperty()
Actor
getProperty
in interface Actor
public Property getProperty(java.lang.String ID)
Actor
getProperty
in interface Actor
ID
- key-name for the property.
public void add(Property prop)
Actor
add
in interface Actor
prop
- property to be addedpublic void setMode(java.lang.String type)
Actor
setMode
in interface Actor
type
- new type (mode) of this actorpublic java.lang.String getMode()
Actor
getMode
in interface Actor
public DBActor prototype()
Actor
prototype
in interface Actor
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
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 openpublic void publishChange(Model m, int type, int argument)
publishChange
in interface Listener
m
- Property that changedtype
- currently only 0 (Changed) is firedpublic void init(Properties properties)
init
in interface Actor
public void removeProperty(java.lang.String ID)
Actor
removeProperty
in interface Actor
ID
- key-name of property to remove.
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |