|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ic.doc.automed.reps.Model
public class Model
The Model class
Construct| Method Summary | |
|---|---|
Construct |
createConstruct(java.lang.String cName,
int cClass,
boolean isRoot)
Creates a new construct and add to the model. |
static Model |
createModel(java.lang.String modelName)
Creates a new model with the given name. |
static boolean |
exists(int MID)
|
static boolean |
exists(java.lang.String modelName)
|
void |
exportConstructs(java.io.OutputStream os)
|
void |
exportConstructs(java.io.PrintWriter pw)
|
java.awt.Color |
getBackgroundColor()
Return the default background colour to be used from drawing SchemaObjects of this Model. |
Construct |
getConstruct(java.lang.String name)
Returns the named construct in the model or throws an AutoMedException if the construct name doesn't exist in the model. |
Construct[] |
getConstructs()
Returns an array of all the constructs in the model. |
Construct[] |
getConstructs(boolean full)
Get a list of Construct objects associated to a Model
object for generating XML structure. |
java.awt.Color |
getForegroundColor()
Return the default foreground colour to be used from drawing SchemaObjects of this Model. |
PersistentKey |
getKey()
Implements the PersistentObject interface |
int |
getMID()
Returns the repository identifer of the model. |
static Model |
getModel(int MID)
Returns a reference to the Model with the given MID. |
static Model |
getModel(java.lang.String name)
Returns a reference to the Model with the given modelName. |
java.lang.String |
getModelDescription()
Returns a description of the model, each construct along with their schemes is listed in a way suitable for printing. |
java.lang.String |
getModelDescription(boolean full)
Returns a description of the model, each construct along with its schemes are listed in a way suitable for printing. |
static Model[] |
getModels()
Returns an array of all models. |
java.lang.String |
getName()
Returns the name of the model. |
java.util.Map |
getPersistentAttributes()
Implements the PersistentObject interface |
java.awt.Color |
getTextColor()
Return the default text colour to be used from drawing SchemaObjects of this Model. |
java.util.List |
getTypeHierarchy()
Get a list of TypeHierarchy objects associated to this model |
void |
importConstructs(java.io.InputStream is)
|
static Model |
read(java.io.InputStream is)
|
static Model |
read(java.io.InputStream is,
java.lang.String name)
|
static void |
reloadModels()
This method empties the cached model data and then reloads it from the MDR as if the class had just been loaded. |
void |
remove()
Removes the Model from the repository. |
protected void |
removeConstructFromMap(java.lang.String name)
THIS METHOD DOESN'T DO ANYTHING AT THE MOMENT Sets the content of a particular position of the model's constructs list. |
static void |
removeModel(java.lang.String modelName)
Removes the Model with the given modelName. |
void |
retract()
Removes the Model from the repository, together with all associated information --- in particular all Constructs belonging to the model are removed, and hence all SchemaObjects, and hence all Transformations on those objects. |
void |
setBackgroundColor(java.awt.Color c)
Set the default background colour to be used from drawing SchemaObjects of this Model. |
void |
setForegroundColor(java.awt.Color c)
Set the default foreground colour to be used from drawing SchemaObjects of this Model. |
void |
setName(java.lang.String modelName)
Sets the model's name. |
void |
setTextColor(java.awt.Color c)
Set the default text colour to be used from drawing SchemaObjects of this Model. |
java.lang.String |
toString()
|
void |
write(java.io.OutputStream os)
|
void |
write(java.io.PrintWriter pw)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public static void reloadModels()
public static Model createModel(java.lang.String modelName)
throws IntegrityException
modelName - name of the model.
IntegrityException - if model already exists
public static void removeModel(java.lang.String modelName)
throws IntegrityException
modelName - name of the model to be removed.
IntegrityException - if model does not exist
public void remove()
throws IntegrityException
IntegrityExceptionpublic void retract()
public static Model[] getModels()
public static boolean exists(java.lang.String modelName)
public static boolean exists(int MID)
public static Model getModel(java.lang.String name)
throws NotFoundException
Model with the given modelName.
modelName - name of the model.
NotFoundException
public static Model getModel(int MID)
throws NotFoundException
Model with the given MID.
MID - numeric identifier of the model.
NotFoundException
public Construct createConstruct(java.lang.String cName,
int cClass,
boolean isRoot)
cName - name of the construct.cClass - class of the construct (one of
CONSTRUCT_CLASS_NODAL,
CONSTRUCT_CLASS_LINK,
CONSTRUCT_CLASS_LINK_NODAL, and
CONSTRUCT_CLASS_CONSTRAINT, see Constants).isRoot - set to true if the construct is a
construct type of its underlying data model; false
otherwise.
public java.lang.String getName()
public int getMID()
public Construct getConstruct(java.lang.String name)
throws NotFoundException
NotFoundException - if the named construct doesn't exist in the
model.public Construct[] getConstructs()
public Construct[] getConstructs(boolean full)
Construct objects associated to a Model
object for generating XML structure. We are interested in having full
details about every Construct and its schemes.
full - a boolean flag indicating whether or not to get the full
construct details. If set to false, it calls getConstructs()
method.
public java.util.List getTypeHierarchy()
throws AutoMedException
TypeHierarchy objects associated to this model
AutoMedException
public void setName(java.lang.String modelName)
throws IntegrityException
modelName - new name of model.
MDRException
java.sql.SQLException
DSRException
java.io.IOException
IntegrityException
protected void removeConstructFromMap(java.lang.String name)
throws IntegrityException
position - the position in the model's list of constructs whose
content is to be set.con - the new construct to be inserted into the given position.
IntegrityExceptionpublic java.lang.String getModelDescription()
getModelDescription(boolean) passing it false to get the
shorter description.
public java.lang.String getModelDescription(boolean full)
full - If true, expand construct descriptions in scheme
public void importConstructs(java.io.InputStream is)
throws java.io.IOException,
AutoRepException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
AutoMedException
java.sql.SQLExceptionpublic void exportConstructs(java.io.OutputStream os)
public void exportConstructs(java.io.PrintWriter pw)
public static Model read(java.io.InputStream is)
throws java.io.IOException,
AutoRepException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
AutoMedException
java.sql.SQLException
public static Model read(java.io.InputStream is,
java.lang.String name)
throws java.io.IOException,
AutoRepException,
AutoMedException,
java.sql.SQLException
java.io.IOException
AutoRepException
AutoMedException
java.sql.SQLExceptionpublic void write(java.io.OutputStream os)
public void write(java.io.PrintWriter pw)
public java.awt.Color getForegroundColor()
SchemaObjects of this Model.
Color, or null if no default colour is set
for this Modelpublic void setForegroundColor(java.awt.Color c)
SchemaObjects of this Model.
A - Color that will be used when drawing
SchemaObjects of this Model where no
+ invidual foreground color has been set.public java.awt.Color getBackgroundColor()
SchemaObjects of this Model.
Color, or null if no default colour is set
for this Modelpublic void setBackgroundColor(java.awt.Color c)
SchemaObjects of this Model.
A - Color that will be used when drawing
SchemaObjects of this Model where no
+ invidual background color has been set.public java.awt.Color getTextColor()
SchemaObjects of this Model.
Color, or null if no default colour is set
for this Modelpublic void setTextColor(java.awt.Color c)
SchemaObjects of this Model.
A - Color that will be used when drawing
SchemaObjects of this Model where no
+ invidual text color has been set.public java.lang.String toString()
toString in class java.lang.Objectpublic PersistentKey getKey()
PersistentObject interface
getKey in interface PersistentObjectPersistentObject.getKey()public java.util.Map getPersistentAttributes()
PersistentObject interface
getPersistentAttributes in interface PersistentObjectPersistentObject.getPersistentAttributes()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||