|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ic.doc.automed.reps.SchemaObject
public class SchemaObject
The SchemaObject class
Schema,
Scheme,
Construct| Method Summary | |
|---|---|
boolean |
appearsInSchemeOf(SchemaObject so)
Determines whether or not the schema object appears anywhere in the scheme of another schema object. |
int |
compare(java.lang.Object o1,
java.lang.Object o2)
|
int |
compareTo(java.lang.Object o)
|
protected static SchemaObject |
createSchemaObject(Schema ownerSchema,
Construct cType,
AutoMedType amtype,
java.lang.Object[] schemeObjects)
|
protected static SchemaObject |
createSchemaObject(Schema ownerSchema,
Construct cType,
java.lang.Object[] schemeObjects)
All schemaobjects belong to schemas Creates a new schema object. |
protected static SchemaObject |
createSchemaObjectFromDB(int obid,
Schema schema)
Instantiates a SchemaObject whose record already
exists in the STR. |
java.lang.String |
debugString()
A String representation of this object useful for debugging code |
boolean |
equals(java.lang.Object o)
|
java.awt.Point |
getAbsolutePosition()
Return the absolute coordinate of this . |
java.awt.Color |
getBackgroundColor()
|
Construct |
getConstruct()
Returns the construct type of the schema object. |
Construct |
getConstructType()
|
SchemaObject[] |
getDependentSchemaObjects()
Return all SchemaObjects which have a reference to this
SchemaObject in their scheme. |
SchemaObject[] |
getDependentSchemaObjects(Construct c)
Return those SchemaObjects of a particular Construct which have a reference to this SchemaObject in
their scheme. |
java.awt.Color |
getForegroundColor()
|
PersistentKey |
getKey()
|
static SchemaObject |
getKnownSchemaObject(int obid)
Similiar to getSchemaObject(int) except that it throws
a runtime exception InconsistentException if the obid is
not found. |
java.lang.String |
getLabel()
Get the text used to label this SchemaObject. |
java.awt.Point |
getLabelPosition()
|
int |
getLabelXPos()
|
int |
getLabelYPos()
|
int |
getOBID()
Returns the schema object identifier (OBID) of a schema object. |
java.util.Map |
getPersistentAttributes()
|
java.awt.Point |
getPosition()
Return the Point that represents the position of this
Positionable in a Panel. |
Positionable |
getPositionedRelativeTo()
Return the Positionable this is relative to. |
SchemaObject[] |
getReferencedSchemaObjects()
Returns the set of SchemaObjects that are referenced directly or indirectly by this SchemaObject. |
java.lang.Object |
getRepObject()
|
Schema |
getSchema()
Returns the Schema to which the SchemaObject belongs. |
static SchemaObject |
getSchemaObject(int obid)
Returns the SchemaObject reference that has the given
schema object identifier (OBID). |
static SchemaObject |
getSchemaObjectByOBID(int obid)
Deprecated. use getSchemaObject(int) instead |
int |
getSchemaObjectType()
Return the type id of this schema object - Note link objects will not have a type |
java.lang.String |
getSchemaObjectTypeName()
Return the type name of this schema object - Note link objects will not have a type |
java.lang.Object[] |
getSchemeDefinition()
All SchemaObjects when they are created by methods such as Schema.createSchemaObject, Schema.applyAddTransformation
and Transformation.createAddTransformation require that an Object
array be supplied that defines the scheme of the new SchemaObject. |
java.lang.Object[] |
getSchemeNames()
A shorthand for #getSchemeNames(false) |
java.lang.Object[] |
getSchemeNames(boolean keyOnly)
Return the names of all objects in the scheme of this SchemaObject. |
java.lang.Object[] |
getSchemeNames(int idDepth,
int typeDepth)
|
java.lang.Object[] |
getSchemeNames(int idDepth,
int typeDepth,
boolean keyOnly)
|
java.lang.String |
getSchemeNamesString()
Same as calling #Schema.getSchemaNameString(false) |
java.lang.String |
getSchemeNamesString(boolean keyOnly)
Returns the scheme representation this SchemaObject using
brackets
as set by Schema.setOpenCloseSchemeBracket. |
java.lang.String |
getSchemeNamesString(int idDepth,
int typeDepth)
|
java.lang.String |
getSchemeNamesString(int idDepth,
int typeDepth,
boolean keyOnly)
|
static java.lang.String |
getSchemeNamesString(java.lang.Object[] schemeDef)
Return the scheme string that would return from creating a SchemaObject using the supplied array of Objects. |
Scheme[] |
getSchemeObjects()
Returns an array of schema objects that are contained in the scheme of this schema object. |
java.lang.String |
getSchemeString()
|
java.lang.String |
getSchemeString(Schema context)
|
Schema |
getSubnetSchema()
Find the extensional schema in the same subnetwork as this SchemaObject. |
java.awt.Color |
getTextColor()
|
protected static SchemaObject |
getTransformationObject(int objectID)
|
Transformation[] |
getTransformations()
Find the set of Transformations that involve this SchemaObject. |
java.lang.String |
getValue()
Returns the name/value of the schema object. |
int |
getXPos()
|
int |
getYPos()
|
static SchemaObject |
persist(java.util.Map persistentFields)
|
static java.lang.Object[] |
readScheme(Schema schema,
Construct construct,
Syntax.Tokenizer in)
|
static java.lang.String |
readSchemeRef(Syntax.Tokenizer in)
|
static java.lang.Object[] |
readSchemeTokens(Syntax.Tokenizer in)
|
void |
remove()
Remove the SchemaObject form the repository. |
void |
retract()
Removes the SchemaObject from the repository, and all other objects which depend upon it. |
protected boolean |
sameScheme(SchemaObject so)
Determines whether or not the scheme is the same as that of the given SchemaObject. |
void |
setAbsolutePosition(int x,
int y)
|
void |
setBackgroundColor(java.awt.Color c)
|
void |
setConstructType(Construct cType)
Sets the construct type of the schema object. |
void |
setForegroundColor(java.awt.Color c)
|
void |
setLabel(java.lang.String label)
|
void |
setLabelPosition(int x,
int y)
|
void |
setLabelXPos(int x)
|
void |
setLabelYPos(int y)
|
void |
setPosition(int x,
int y)
|
void |
setSchemaObjectType(int tid)
Set type_id for schema object |
void |
setTextColor(java.awt.Color c)
|
void |
setValue(java.lang.String v)
Sets the name/value of the schema object. |
void |
setXPos(int x)
|
void |
setYPos(int y)
|
java.lang.String |
toLaTeX()
Returns the SchemaObject in a form that may rendered by
the hdm.sty LaTeX package. |
java.lang.String |
toString()
Ensures that instances of this class print in the "correct" AutoMed scheme notation |
void |
write(java.io.OutputStream os)
|
void |
write(java.io.PrintWriter pw)
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public int getSchemaObjectType()
throws NotFoundException
NotFoundException
public java.lang.String getSchemaObjectTypeName()
throws NotFoundException
NotFoundException
protected static SchemaObject createSchemaObject(Schema ownerSchema,
Construct cType,
java.lang.Object[] schemeObjects)
throws TypeMismatchException,
IntegrityException
ownerSchema - the schema in whose context the SchemaObject
is being created. Set to null if the schema object being
created does not exist in the context of a schema, i.e., it is a
transformation object.cType - construct type (of class Construct) of the
schema object. Set to null if the construct being
constructed is not a proper Construct of its
underlying model (e.g. cardinality constraints for ER relationships).schemeObjects - array of String and/or schema
objects contained in the scheme of the new schema object. The first
String value is used as the name/value of this object.
TypeMismatchException
IntegrityException
protected static SchemaObject createSchemaObject(Schema ownerSchema,
Construct cType,
AutoMedType amtype,
java.lang.Object[] schemeObjects)
throws TypeMismatchException,
IntegrityException
TypeMismatchException
IntegrityExceptionpublic Schema getSubnetSchema()
protected static SchemaObject createSchemaObjectFromDB(int obid,
Schema schema)
throws IntegrityException
SchemaObject whose record already
exists in the STR.
obid - the schema object identifier (OBID) found in the STR.schema - the schema in whose context the SchemaObject
is being created. Set to null if the schema object being
created does not exist in the context of a schema, i.e., it is a
transformation object.
IntegrityExceptionpublic Construct getConstruct()
public Construct getConstructType()
public Schema getSchema()
Schema to which the SchemaObject belongs. This will
either be an Extentional Schema, or a schema created by the
transformation that created this SchemaObject.
public java.lang.String getValue()
public java.lang.Object[] getSchemeNames()
#getSchemeNames(false)
public java.lang.Object[] getSchemeNames(boolean keyOnly)
Model
used by the SQLWrapper, this would be an object array containing
'person', 'id', and 'notnull'
keyOnly - when set true causes non-key names in the scheme to be
ignored, In the example given above, this would reduce the array to
only contain 'person' and 'id'
Object array contain the strings of the name. Note
that where the schema name is nested, then so will the array be
a nested array of objects.
public java.lang.Object[] getSchemeNames(int idDepth,
int typeDepth)
public java.lang.Object[] getSchemeNames(int idDepth,
int typeDepth,
boolean keyOnly)
public int getXPos()
getXPos in interface Positionablepublic int getYPos()
getYPos in interface Positionablepublic void setXPos(int x)
setXPos in interface Positionablepublic void setYPos(int y)
setYPos in interface Positionablepublic java.awt.Point getPosition()
PositionablePoint that represents the position of this
Positionable in a Panel. Note that depending on
the implementation of the interface, this might a coordinate
relative to some other positionable
getPosition in interface Positionablepublic Positionable getPositionedRelativeTo()
PositionablePositionable this is relative to. If not relative
to some other Positionable then return null.
getPositionedRelativeTo in interface Positionablepublic java.awt.Point getAbsolutePosition()
Positionable
getAbsolutePosition in interface Positionable
public void setPosition(int x,
int y)
setPosition in interface Positionable
public void setAbsolutePosition(int x,
int y)
setAbsolutePosition in interface Positionablepublic int getLabelXPos()
getLabelXPos in interface Positionablepublic int getLabelYPos()
getLabelYPos in interface Positionablepublic void setLabelXPos(int x)
setLabelXPos in interface Positionablepublic void setLabelYPos(int y)
setLabelYPos in interface Positionable
public void setLabelPosition(int x,
int y)
setLabelPosition in interface Positionablepublic java.awt.Point getLabelPosition()
getLabelPosition in interface Positionablepublic java.lang.String getLabel()
getLabel in interface Positionablepublic void setLabel(java.lang.String label)
setLabel in interface Positionablepublic java.lang.Object getRepObject()
getRepObject in interface Positionablepublic java.awt.Color getForegroundColor()
getForegroundColor in interface Positionablepublic void setForegroundColor(java.awt.Color c)
setForegroundColor in interface Positionablepublic java.awt.Color getBackgroundColor()
getBackgroundColor in interface Positionablepublic void setBackgroundColor(java.awt.Color c)
setBackgroundColor in interface Positionablepublic java.awt.Color getTextColor()
getTextColor in interface Positionablepublic void setTextColor(java.awt.Color c)
setTextColor in interface Positionablepublic Scheme[] getSchemeObjects()
public java.lang.Object[] getSchemeDefinition()
Schema.createSchemaObject, Schema.applyAddTransformation
and Transformation.createAddTransformation require that an Object
array be supplied that defines the scheme of the new SchemaObject. This
method reconstructs this Object array.
public java.lang.String getSchemeNamesString()
throws InconsistentException
#Schema.getSchemaNameString(false)
InconsistentExceptionpublic java.lang.String getSchemeNamesString(boolean keyOnly)
SchemaObject using
brackets
as set by Schema.setOpenCloseSchemeBracket. Schemes are the
standard way of identifying SchemaObjects in AutoMed in any
user oriented presentation of a Schema. For example
a key attribute might have the scheme
<<person,id,key>>
keyOnly - set true causes only those elements of the scheme declared
as key in the underlying Construct are to be included. For
the key attribute example, this key scheme might be
<<person,id,key>>. Which elements of a scheme are key is
decided upon when the underlying Construct is created by
calls on the Model to which it belongs.
public java.lang.String getSchemeNamesString(int idDepth,
int typeDepth)
public java.lang.String getSchemeNamesString(int idDepth,
int typeDepth,
boolean keyOnly)
public static java.lang.String getSchemeNamesString(java.lang.Object[] schemeDef)
SchemaObject using the supplied array of Objects.
schemeDef - An array of Object instances that could be
used as the scheme definition in Schema.applyAddTransformation(uk.ac.ic.doc.automed.reps.Construct, java.lang.Object[], java.lang.String, java.lang.String)
SchemaObject
were to be created.public java.lang.String toString()
toString in class java.lang.Objectpublic void setConstructType(Construct cType)
cType - the construct type of the schema object.Construct
public void setValue(java.lang.String v)
throws InconsistentException
v - the string that is to be the name/value of the schema object.
InconsistentException
public void setSchemaObjectType(int tid)
throws InconsistentException
InconsistentExceptionpublic int getOBID()
public static SchemaObject getSchemaObjectByOBID(int obid)
getSchemaObject(int) instead
public static SchemaObject getSchemaObject(int obid)
throws NotFoundException
SchemaObject reference that has the given
schema object identifier (OBID).
obid - the object identifier (OBID) of a schema object
that must already exist in the repository
SchemaObject reference that has the given
schema object identifier (OBID).
NotFoundException - if not object with obid foundpublic static SchemaObject getKnownSchemaObject(int obid)
getSchemaObject(int) except that it throws
a runtime exception InconsistentException if the obid is
not found. Intended only for use with the AutoMed implementation,
and not by user applications unless they are sure obid exists in the
repository
protected static SchemaObject getTransformationObject(int objectID)
throws InconsistentException,
IntegrityException
InconsistentException
IntegrityExceptionprotected boolean sameScheme(SchemaObject so)
SchemaObject.
so - the SchemaObject whose scheme is to be compared.
true if the scheme is the same as that of the
given SchemaObject; false otherwise.
public boolean appearsInSchemeOf(SchemaObject so)
throws InconsistentException
so - the SchemaObject whose scheme is to be compared.
true if the schema object appears anywhere in the
scheme of the given SchemaObject; false otherwise.
InconsistentExceptionpublic java.lang.String debugString()
public void remove()
throws IntegrityException
SchemaObject form the repository. Note that this
will only work if the SchemaObject is not used in any transformations
IntegrityException - if the SchemaObject appears in any
transformationspublic void retract()
public Transformation[] getTransformations()
throws InconsistentException
Transformations that involve this SchemaObject.
InconsistentException - if there is some unexpected
inconsistency in the repository.public SchemaObject[] getReferencedSchemaObjects()
public SchemaObject[] getDependentSchemaObjects()
SchemaObjects which have a reference to this
SchemaObject in their scheme.
public SchemaObject[] getDependentSchemaObjects(Construct c)
SchemaObjects of a particular Construct which have a reference to this SchemaObject in
their scheme.
c - The Construct type of the SchemaObjects to
return. If null, then all SchemaObjects are returnedpublic int compareTo(java.lang.Object o)
compareTo in interface java.lang.Comparable
public int compare(java.lang.Object o1,
java.lang.Object o2)
compare in interface java.util.Comparatorpublic boolean equals(java.lang.Object o)
equals in interface java.util.Comparatorequals in class java.lang.Object
public static java.lang.Object[] readScheme(Schema schema,
Construct construct,
Syntax.Tokenizer in)
throws SyntaxException,
NotFoundException
SyntaxException
NotFoundException
public static java.lang.Object[] readSchemeTokens(Syntax.Tokenizer in)
throws SyntaxException,
NotFoundException
SyntaxException
NotFoundException
public static java.lang.String readSchemeRef(Syntax.Tokenizer in)
throws SyntaxException,
NotFoundException
SyntaxException
NotFoundExceptionpublic void write(java.io.OutputStream os)
public void write(java.io.PrintWriter pw)
public java.lang.String getSchemeString()
public java.lang.String getSchemeString(Schema context)
public PersistentKey getKey()
getKey in interface PersistentObjectpublic java.util.Map getPersistentAttributes()
getPersistentAttributes in interface PersistentObject
public static SchemaObject persist(java.util.Map persistentFields)
throws AutoMedException
AutoMedExceptionpublic java.lang.String toLaTeX()
SchemaObject in a form that may rendered by
the hdm.sty LaTeX package.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||