Construct
Keywords: uk.ac.ic.doc.automed.reps.Construct,Construct class

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## uk.ac.ic.doc.automed.reps
Class Construct

    java.lang.Object
      |
      +--uk.ac.ic.doc.automed.reps.Construct

All Implemented Interfaces:
  java.util.Comparator

Direct Known Subclasses:
  ConstructWithModelingProgram

public class Construct
extends java.lang.Object
implements java.util.Comparator

The Construct class

Author:
  Michael Boyd (mboyd@doc.ic.ac.uk), Peter McBrien (pjm@doc.ic.ac.uk), Nerissa Tong (nnyt98@doc.ic.ac.uk)

  Each Construct represents a type of object in the language being modelled. The assumption is that each modelling language object can be represented by one of the first four classes in table 1. The other two are used to help build a Construct's scheme.

  Each Construct has a scheme. If you think of a Construct as a Java Class* and a SchemaObject as Java Object then a Construct's scheme is it's constructor signiture and SchemaObjects are instances of a Construct and are created by supplying arguments to SchemaObject.createSchemaObject() as specified by the Construct's scheme.
  *Not to be confused with the actual Class Construct or a Construct's HDM class in table 1)

  Table 1

  Construct Class | Abbrev. | Description
  --- | --- | ---
  Nodal | N | An object with extent (typically an entity type) that can exist independantly of anything else. Corresponds to an HDM node
  Link | L | An association between at least 2 nodal or link objects - each tuple of the extent identifies one tuple from the extent of each of the associated objects. Corresponds to an HDM edge between at least two nodes or edges.
  Link-Nodal | LN | A link which (like a normal link) associates some pre-existing nodes or links as well as some new nodes which are created along with the link. After construction, the HDM could just as easily have been created with a link construct and some nodal constucts, the point here is that the new nodes cannot exist independently of the pre-existing nodes and so must be created along with their association to them - e.g. relational fields can only exist in the context of a table.
  Constraint | C | A sentence with holes in it which are filled by instances of the SchemaObject. Specifies some constraint in an appropriate language - e.g. a cardinality constraint on an attribute. Corresponds to an HDM constraint. The actual syntax for specifying the holes and what they get filled with has yet to be specified.
  Alternation | A | This cannot be an object in the modelling language proper, it is used to specify a list of alternatives to a scheme argument of another Construct. An alternation object's scheme is the list of alternatives - No corresponding HDM.
  Sequence | S | This cannot be an object in the modelling language proper, it is used to specify a sequence of constructs/labels as an argument to another construct's scheme. This is needed when a sequence of scheme aurumgents can be repeated. E.g. an n-ary relationship where each entity has an associated cardinality could be specified with the scheme argument 2..n of the sequence (entity, cardinality) - No corresponding HDM

  Each argument to the Construct scheme is either a name (String) or a reference to another Construct. The first name argument is the actual value of instances of the construct. Any other name arguments have auxillary typeless objects created for them (on a per instance basis). E.g. an er attribute might have the scheme <> where the entity reference is the entity the attribute is associated with, the first name is the name of the attribute (and the name of the corresponding node in HDM), the second name could be any other label you might want to attach to an attribute. Note that this scheme has no edge name argument, it could do but the relationship between an attribute and its entity is not normally named.

  In the MDR (the repository where models are stored) each scheme argument has an associated HDM type, these are

  Table 2

  HDM Type | Abbrev. | Scheme Argument Description
  --- | --- | ---
  Node | N | The name of a new node.
  Edge | E | The name of a new edge
  Reference | R | A reference to another node or edge
  Constraint | C | The constraint sentence of a constraint object (with holes)
  Null | Z | Used for a scheme argument that has no correspondence with the HDM - e.g. a construct refence in an alternation

  There are only certain allowable combinations of scheme argument type (name | construct) and HDM type and each combination corresponded to a method call on a construct to add a new argument to its scheme.

  Table 3

  Argument Type : HDM Type | Method
  --- | ---
  Name:NodeName (N:N) | addNodeNameScheme()
  Name:EdgeName (N:E) | addEdgeNameScheme()
  Name:Constraint (N:C) | addConstraintScheme()
  Construct:Reference (C:R) | addReferenceScheme()
  Construct:Null (C:Z) | addReferenceScheme()**
  Name:Null (N:Z) | addLabelScheme()

  **The addReferenceScheme() methods choses HDM type R if the Construct class is nodal, link, link-nodal or constraint and HDM type Z otherwize.

  Each allowable combination has a constraint on the cardinality that you can specify for that argument, the allowable combinations along with the class of Construct they are valid in and the allowable cardinalities are summarized in the table below.

  Table 4

  Construct Class | Argument Type : HDM Type
  --- | ---
  N:N | N:E | N:C | C:R | C:Z | N:Z
  Nodal | 1:1 |  |  |  |  | 0..N
  Link |  | 1:1 |  | 2..N |  | 0..N
  Link-Nodal | 1:N | 1:1 |  | 2..N |  | 0..N
  Constraint |  |  | 1:1 | 0..N |  | 0..N
  Alternation |  |  |  |  | 0..N | 0..N
  Sequence |  |  |  |  | 0..N | 0..N

See Also:
  `Model`, `ConstructScheme`

Field Summary
`static int` | `CLASS_ALTERNATION` Class of construct which acts as a place holder for one of list of alternative constructs.
`static int` | `CLASS_CONSTRAINT` Class of construct for constraints, i.e.
`static int` | `CLASS_LINK` Class of construct for linking constructs, i.e.
`static int` | `CLASS_LINK_NODAL` Class of construct for link-nodal constructs, i.e.
`static int` | `CLASS_MAXIMUM`
`static int` | `CLASS_MINIMUM`
`static int` | `CLASS_NODAL` Class of construct for nodal constructs, i.e.
`static int` | `CLASS_SEQUENCE` Class of construct which acts as a place holder for a list of constructs.
`static int` | `CONSTRUCT_TYPE_ANY`
`static int` | `CONSTRUCT_TYPE_ARRAY`
`static int` | `CONSTRUCT_TYPE_REFERENCE`
`static Construct` | `ConstructAny`
`static Construct` | `ConstructArray`
`static Construct` | `ConstructReference`

Constructor Summary
`protected` | `Construct(Model model, int cid, java.lang.String constructName, int constructClass, boolean constructIsRoot)` Instantiates a `Construct`, which is assumed to already exist in the `STR`.

Method Summary
`ConstructScheme` | `addConstraintScheme()` Constraint schemes can only be added to constructs of type Nodal, Link-Nodal, Link or Constraint Defaults to isKey = true, 1..1
`ConstructScheme` | `addConstraintScheme(boolean isKey)`
`ConstructScheme` | `addConstraintScheme(int lower, int upper)`
`ConstructScheme` | `addConstraintScheme(int lower, int upper, boolean isKey)`
`ConstructScheme` | `addEdgeNameScheme()` EdgeName schemes can only be added to LINK and LINK-NODAL construct types.
`ConstructScheme` | `addEdgeNameScheme(boolean isKey)`
`ConstructScheme` | `addLabelScheme()` Label schemes are scheme arguments that have no corresponding HDM (except maybe through automatic HDM node and edge names if the label is defined as key for its construct) Defaults to isKey = true, 1..1
`ConstructScheme` | `addLabelScheme(boolean isKey)`
`ConstructScheme` | `addLabelScheme(int lower, int upper)`
`ConstructScheme` | `addLabelScheme(int lower, int upper, boolean isKey)`
`ConstructScheme` | `addNodeNameScheme()` NodeName schemes can only be added to NODAL and LINK-NODAL construct types.
`ConstructScheme` | `addNodeNameScheme(boolean isKey)`
`ConstructScheme` | `addNodeNameScheme(int lower, int upper)`
`ConstructScheme` | `addNodeNameScheme(int lower, int upper, boolean isKey)`
`ConstructScheme` | `addReferenceScheme(Construct type)`
`ConstructScheme` | `addReferenceScheme(Construct type, boolean isKey)`
`ConstructScheme` | `addReferenceScheme(Construct type, int lower, int upper)`
`ConstructScheme` | `addReferenceScheme(Construct type, int lower, int upper, boolean isKey)`
`int` | `compare(java.lang.Object o1, java.lang.Object o2)`
`ConstructScheme` | `createConstructScheme(int schemeType, Construct refCon, boolean isKey, int HDMType, int lBound, int uBound)` Semi-deprecated! See the various addXxxScheme() methods.
`boolean` | `equals(java.lang.Object o)`
`void` | `exportSchemes(java.io.OutputStream os)`
`void` | `exportSchemes(java.io.PrintWriter pw)`
`java.lang.String` | `getArcDrawable()` Returns the name of the class implementing drawable that should be used to draw arc elements of this construct.
`java.awt.Color` | `getBackgroundColor()` Return the default background colour to be used from drawing `SchemaObject`s of this `Construct`.
`int` | `getCID()` Returns the construct identifier (CID) of the construct.
`java.lang.String` | `getConstraintDefinition(java.lang.String constraint_name)` Return the definition of a constraint used within this `Construct`.
`static Construct` | `getConstruct(int cid)` Returns the `Construct` identified by the given construct identifier (CID).
`int` | `getConstructClass()` Returns the class of the construct.
`static java.lang.String` | `getConstructClassString(int conClass)`
`java.lang.String` | `getConstructDescription()` Returns a printable description of the construct including all of its schemes.
`java.awt.Color` | `getForegroundColor()` Return the default foreground colour to be used from drawing `SchemaObject`s of this `Construct`.
`Model` | `getModel()` Return the `Model` to which this Construct belongs
`java.lang.String` | `getName()` Returns the name of the construct.
`SchemaObject[]` | `getSchemaObjects()` Find all `SchemaObjects` that are instances of a particular Construct.
`ConstructScheme[]` | `getScheme()` Returns an array of `ConstructScheme` objects representing the scheme of the construct.
`java.awt.Color` | `getTextColor()` Return the default text colour to be used from drawing `SchemaObject`s of this `Construct`.
`protected int` | `getValuePosInScheme()` Returns the position in the construct's scheme where the construct's name is, i.e.
`java.lang.String` | `getVertexDrawable()` Returns the name of the class implementing drawable that should be used to draw nodal elements of this construct.
`void` | `importSchemes(java.io.InputStream is)`
`boolean` | `isRoot()` Returns whether or not the construct is a construct of its underlying model.
`void` | `remove()` Removes the Construct from the repository if it is not being used, and removes all the construct's Scheme elements.
`protected static void` | `removeConstructFromMap(Construct con)` Deprecated. Remove constructs using @link remove() which will also do the job of this method Removes from the HashMap that holds the CID and ref to all Construct objs.
`void` | `retract()` Removes the Construct from the repository, and all other objects which depend upon it.
`void` | `setArcDrawable(java.lang.String arcDrawable)` Sets the name of the class used to draw the arc of this `Construct` in any diagram containing it.
`void` | `setBackgroundColor(java.awt.Color c)` Set the default background colour to be used from drawing `SchemaObject`s of this `Construct`.
`void` | `setConstraintDefinition(java.lang.String constraint_name, java.lang.String constraint_definition)` Set the definition of a constraint used within this `Construct`.
`void` | `setConstructClass(int constructClass)` Sets the class of the construct.
`void` | `setForegroundColor(java.awt.Color c)` Set the default foreground colour to be used from drawing `SchemaObject`s of this `Construct`.
`void` | `setName(java.lang.String constructName)` Sets the name of the construct to the given string.
`void` | `setRoot(boolean root)` Sets whether or not the construct is a construct type of its underlying data model.
`void` | `setTextColor(java.awt.Color c)` Set the default text colour to be used from drawing `SchemaObject`s of this `Construct`.
`void` | `setVertexDrawable(java.lang.String vertexDrawable)` Sets the name of the class used to draw the vertex of this `Construct` in any diagram containing it.
`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, toString, wait, wait, wait`

Field Detail

### CLASS_MINIMUM

    public static final int CLASS_MINIMUM

See Also:
  Constant Field Values

### CLASS_NODAL

    public static final int CLASS_NODAL

  Class of construct for nodal constructs, i.e. those constructs which can exist independently of other constructs in a modelling language. For example, in ER models, entities are nodal constructs.

  See Also:
    Constant Field Values

### CLASS_LINK_NODAL

    public static final int CLASS_LINK_NODAL

  Class of construct for link-nodal constructs, i.e. those constructs which are attached to other constructs in a modelling language, and which can have an extent. For example, in ER models, attributes are link-nodal.

  See Also:
    Constant Field Values

### CLASS_LINK

    public static final int CLASS_LINK

  Class of construct for linking constructs, i.e. those constructs which are used to associated constructs with each other, and which can have an extent. For example, in ER models, relationships are link constructs.

  See Also:
    Constant Field Values

### CLASS_CONSTRAINT

    public static final int CLASS_CONSTRAINT

  Class of construct for constraints, i.e. those constructs which do not have an extent, but which restrict the extent of other constructs. For example, in ER models, isa hierarchies are constraint constructs.

  See Also:
    Constant Field Values

### CLASS_ALTERNATION

    public static final int CLASS_ALTERNATION

  Class of construct which acts as a place holder for one of list of alternative constructs. No `SchemaObject` can be an instance of this class of construct.

  See Also:
    Constant Field Values

### CLASS_SEQUENCE

    public static final int CLASS_SEQUENCE

  Class of construct which acts as a place holder for a list of constructs. No `SchemaObject` can be an instance of this class of construct.

  See Also:
    Constant Field Values

### CLASS_MAXIMUM

    public static final int CLASS_MAXIMUM

See Also:
  Constant Field Values

### CONSTRUCT_TYPE_ARRAY

    public static final int CONSTRUCT_TYPE_ARRAY

See Also:
  Constant Field Values

### CONSTRUCT_TYPE_ANY

    public static final int CONSTRUCT_TYPE_ANY

See Also:
  Constant Field Values

### CONSTRUCT_TYPE_REFERENCE

    public static final int CONSTRUCT_TYPE_REFERENCE

See Also:
  Constant Field Values

### ConstructReference

    public static final Construct ConstructReference

### ConstructAny

    public static final Construct ConstructAny

### ConstructArray

    public static final Construct ConstructArray

Constructor Detail

### Construct

    protected Construct(Model model,
                        int cid,
                        java.lang.String constructName,
                        int constructClass,
                        boolean constructIsRoot)

  Instantiates a `Construct`, which is assumed to already exist in the `STR`.

Parameters:
  `model` - the model to which the construct belongs.
  `cid` - the construct identifier (CID) of the construct returned by the MDR.
  `constructName` - name of the construct.
  `constructClass` - class of the construct.
  `constructIsRoot` - set to `true` if the construct is root (i.e., it is itself a construct in its underlying model); `false` otherwise.

Method Detail

### compare

    public int compare(java.lang.Object o1,
                       java.lang.Object o2)

  Specified by:
    `compare` in interface `java.util.Comparator`

### equals

    public boolean equals(java.lang.Object o)

  Specified by:
    `equals` in interface `java.util.Comparator`
  Overrides:
    `equals` in class `java.lang.Object`

### removeConstructFromMap

    protected static void removeConstructFromMap(Construct con)

  Deprecated. Remove constructs using @link remove() which will also do the job of this method Removes from the HashMap that holds the CID and ref to all Construct objs.

### remove

    public void remove()

  Removes the Construct from the repository if it is not being used, and removes all the construct's Scheme elements.

  Throws:
    `MDRException` - if the Construct is used to implement a SchemaObject.

### retract

    public void retract()

  Removes the Construct from the repository, and all other objects which depend upon it. In particular any SchemaObject that is based on the this construct is removed, and any Transformation that created that SchemaObject will also be removed.

### createConstructScheme

    public ConstructScheme createConstructScheme(int schemeType,
                                                 Construct refCon,
                                                 boolean isKey,
                                                 int HDMType,
                                                 int lBound,
                                                 int uBound)
                                          throws java.sql.SQLException,
                                                 DSRException,
                                                 MDRException,
                                                 java.io.IOException

  Semi-deprecated! See the various addXxxScheme() methods. Creates a new `ConstructScheme` for the construct.

  Parameters:
    `schemeType` - type of the scheme (one of `Scheme.TYPE_NAME`, `Scheme.TYPE_CONSTRUCT`, `Scheme.TYPE_ALTERNATION`, and `Scheme.TYPE_SEQUENCE`, see `Constants`).
    `refCon` - the type of construct (of class `Construct`) that is represented by the scheme position being created.
    `isKey` - set to `true` if the current scheme position is (part of) the key of the whole scheme; `false` otherwise.
    `HDMType` - the HDM type of the construct's scheme (one of `Scheme.HDM_TYPE_N1`, `Scheme.HDM_TYPE_N2`, `Scheme.HDM_TYPE_P1`, `Scheme.HDM_TYPE_P1`, and `Scheme.HDM_TYPE_C`), see `Constants`.
    `lBound` - minimum occurence of the scheme.
    `uBound` - maximum occurence of the scheme.
  Throws:
    `MDRException`
    `java.sql.SQLException`
    `DSRException`
    `java.io.IOException`
  See Also:
    `ConstructScheme`

### addNodeNameScheme

    public ConstructScheme addNodeNameScheme()
                                      throws ConstructSchemeSyntaxException,
                                             java.sql.SQLException,
                                             DSRException,
                                             MDRException,
                                             java.io.IOException

  NodeName schemes can only be added to NODAL and LINK-NODAL construct types. There can be only one NodeName scheme with card 1..1 for NODAL, no such constraints on LINK-NODAL. Defaults to isKey = true, 1..1

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addNodeNameScheme

    public ConstructScheme addNodeNameScheme(boolean isKey)
                                      throws ConstructSchemeSyntaxException,
                                             java.sql.SQLException,
                                             DSRException,
                                             MDRException,
                                             java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addNodeNameScheme

    public ConstructScheme addNodeNameScheme(int lower,
                                             int upper)
                                      throws ConstructSchemeSyntaxException,
                                             java.sql.SQLException,
                                             DSRException,
                                             MDRException,
                                             java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addNodeNameScheme

    public ConstructScheme addNodeNameScheme(int lower,
                                             int upper,
                                             boolean isKey)
                                      throws ConstructSchemeSyntaxException,
                                             java.sql.SQLException,
                                             DSRException,
                                             MDRException,
                                             java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addEdgeNameScheme

    public ConstructScheme addEdgeNameScheme()
                                      throws ConstructSchemeSyntaxException,
                                             java.sql.SQLException,
                                             DSRException,
                                             MDRException,
                                             java.io.IOException

  EdgeName schemes can only be added to LINK and LINK-NODAL construct types. There can be only one EdgeName scheme with card 1..1. Defaults to isKey = true

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addEdgeNameScheme

    public ConstructScheme addEdgeNameScheme(boolean isKey)
                                      throws ConstructSchemeSyntaxException,
                                             java.sql.SQLException,
                                             DSRException,
                                             MDRException,
                                             java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addReferenceScheme

    public ConstructScheme addReferenceScheme(Construct type)
                                       throws ConstructSchemeSyntaxException,
                                              java.sql.SQLException,
                                              DSRException,
                                              MDRException,
                                              java.io.IOException

  Parameters:
    `type` - == null means any construct I guess, maybe not implementable. construct type ? NODAL : can't have a reference scheme LINK or LINK-NODAL : reference is to an existing construct which has a corresponding HDM node or edge (i.e. scheme) and is used in the construction of this construct's HDM scheme CONSTRAINT : reference is to existing construct which has a corresponding HDM node or edge (i.e. scheme) and is used in the construction of this constraints HDM sentence through scheme references in the construct's constraint schemes (this is also true for constraint scheme arguments of constructs of type NODAL, LINK or LINK-NODAL). ALTERNATIOIN or SEQUENCE : Reference is to existing constructs, no correlation to HDM, just syntax building. Throws exception if construct type = NODAL Defaults to isKey = true, 1..1
    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addReferenceScheme

    public ConstructScheme addReferenceScheme(Construct type,
                                              boolean isKey)
                                       throws ConstructSchemeSyntaxException,
                                              java.sql.SQLException,
                                              DSRException,
                                              MDRException,
                                              java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addReferenceScheme

    public ConstructScheme addReferenceScheme(Construct type,
                                              int lower,
                                              int upper)
                                       throws ConstructSchemeSyntaxException,
                                              java.sql.SQLException,
                                              DSRException,
                                              MDRException,
                                              java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addReferenceScheme

    public ConstructScheme addReferenceScheme(Construct type,
                                              int lower,
                                              int upper,
                                              boolean isKey)
                                       throws ConstructSchemeSyntaxException,
                                              java.sql.SQLException,
                                              DSRException,
                                              MDRException,
                                              java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addConstraintScheme

    public ConstructScheme addConstraintScheme()
                                        throws ConstructSchemeSyntaxException,
                                               java.sql.SQLException,
                                               DSRException,
                                               MDRException,
                                               java.io.IOException

  Constraint schemes can only be added to constructs of type Nodal, Link-Nodal, Link or Constraint Defaults to isKey = true, 1..1

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addConstraintScheme

    public ConstructScheme addConstraintScheme(boolean isKey)
                                        throws ConstructSchemeSyntaxException,
                                               java.sql.SQLException,
                                               DSRException,
                                               MDRException,
                                               java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addConstraintScheme

    public ConstructScheme addConstraintScheme(int lower,
                                               int upper)
                                        throws ConstructSchemeSyntaxException,
                                               java.sql.SQLException,
                                               DSRException,
                                               MDRException,
                                               java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addConstraintScheme

    public ConstructScheme addConstraintScheme(int lower,
                                               int upper,
                                               boolean isKey)
                                        throws ConstructSchemeSyntaxException,
                                               java.sql.SQLException,
                                               DSRException,
                                               MDRException,
                                               java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addLabelScheme

    public ConstructScheme addLabelScheme()
                                   throws ConstructSchemeSyntaxException,
                                          java.sql.SQLException,
                                          DSRException,
                                          MDRException,
                                          java.io.IOException

  Label schemes are scheme arguments that have no corresponding HDM (except maybe through automatic HDM node and edge names if the label is defined as key for its construct) Defaults to isKey = true, 1..1

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addLabelScheme

    public ConstructScheme addLabelScheme(boolean isKey)
                                   throws java.sql.SQLException,
                                          DSRException,
                                          MDRException,
                                          java.io.IOException

    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addLabelScheme

    public ConstructScheme addLabelScheme(int lower,
                                          int upper)
                                   throws ConstructSchemeSyntaxException,
                                          java.sql.SQLException,
                                          DSRException,
                                          MDRException,
                                          java.io.IOException

    `ConstructSchemeSyntaxException`
    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### addLabelScheme

    public ConstructScheme addLabelScheme(int lower,
                                          int upper,
                                          boolean isKey)
                                   throws java.sql.SQLException,
                                          DSRException,
                                          MDRException,
                                          java.io.IOException

    `java.sql.SQLException`
    `DSRException`
    `MDRException`
    `java.io.IOException`

### getName

    public java.lang.String getName()

  Returns the name of the construct.

  Returns:
    name of the construct.

### getConstructClass

    public int getConstructClass()

  Returns the class of the construct.

  Returns:
    the class of the construct.

### isRoot

    public boolean isRoot()

  Returns whether or not the construct is a construct of its underlying model.

  Returns:
    `true` if the construct is a construct of its underlying model; `false` otherwise.

### getScheme

    public ConstructScheme[] getScheme()

  Returns an array of `ConstructScheme` objects representing the scheme of the construct.

  Returns:
    an array of `ConstructScheme` objects representing the scheme of the construct.
  See Also:
    `ConstructScheme`

### getVertexDrawable

    public java.lang.String getVertexDrawable()

  Returns the name of the class implementing drawable that should be used to draw nodal elements of this construct.

  Returns:
    name of the construct.

### setVertexDrawable

    public void setVertexDrawable(java.lang.String vertexDrawable)

  Sets the name of the class used to draw the vertex of this `Construct` in any diagram containing it. By default `Gui` uses `DrawVertex` to paint a construct in a diagram, but this can be replaced by a user provided class.

  Parameters:
    `vertexDrawable` - full class name of the `DrawableVertex` implementation that is to be used by `Gui` when drawing this `Construct`. Normally this is an extension of `DrawVertex`.

### setArcDrawable

    public void setArcDrawable(java.lang.String arcDrawable)

  Sets the name of the class used to draw the arc of this `Construct` in any diagram containing it. By default `Gui` uses `DrawArc` to paint a construct in a diagram, but this can be replaced by a user provided class.

  Parameters:
    `arcDrawable` - full class name of the `DrawableArc` implementation that is to be used by `Gui` when drawing this `Construct`. Normally this is an extension of `DrawArc`.

### getArcDrawable

    public java.lang.String getArcDrawable()

  Returns the name of the class implementing drawable that should be used to draw arc elements of this construct. Note that the class named must implement the `DrawableArc` interface, and normally should extend `DrawArc`.

  Returns:
    name of the construct.

### getConstructDescription

    public java.lang.String getConstructDescription()

  Returns a printable description of the construct including all of its schemes. This calls

### setName

    public void setName(java.lang.String constructName)
                 throws MDRException,
                        java.sql.SQLException,
                        DSRException,
                        java.io.IOException

  Sets the name of the construct to the given string.

  Parameters:
    `constructName` - the string that is to be the construct's name.
  Throws:
    `MDRException`
    `java.sql.SQLException`
    `DSRException`
    `java.io.IOException`

### setConstructClass

    public void setConstructClass(int constructClass)
                           throws MDRException,
                                  java.sql.SQLException,
                                  DSRException,
                                  java.io.IOException

  Sets the class of the construct.

  Parameters:
    `constructClass` - the class of the construct.
  Throws:
    `MDRException`
    `java.sql.SQLException`
    `DSRException`
    `java.io.IOException`

### setRoot

    public void setRoot(boolean root)
                 throws java.sql.SQLException,
                        DSRException,
                        MDRException,
                        java.io.IOException

  Sets whether or not the construct is a construct type of its underlying data model.

  Parameters:
    `root` - set to `true` if the construct is a construct type of its underlying model; `false` otherwise.
  Throws:
    `MDRException`
    `java.sql.SQLException`
    `DSRException`
    `java.io.IOException`

### getCID

    public int getCID()

  Returns the construct identifier (CID) of the construct.

  Returns:
    the construct identifier (CID) of the construct.

### getConstruct

    public static Construct getConstruct(int cid)
                                  throws AutoRepException

  Returns the `Construct` identified by the given construct identifier (CID). Ordinarily one would usr `Model.getConstruct(String)` to get a reference to Construct, i.e. against the Model to which it beongs.

  Returns:
    the `Construct` identified by the given construct identifier (CID).
  Throws:
    `AutoRepException` - if a reference to the construct identified by the given construct identifier (CID) cannot be found.

### getValuePosInScheme

    protected int getValuePosInScheme()
                               throws AutoRepException

  Returns the position in the construct's scheme where the construct's name is, i.e. where the scheme type is Scheme.TYPE_NAME.

  Returns:
    the position in the construct's scheme where the construct's name is, i.e., where the scheme type is Scheme.TYPE_NAME.
  Throws:
    `AutoRepException` - if the position in the construct's scheme where the construct's name is cannot be found.

### getConstructClassString

    public static java.lang.String getConstructClassString(int conClass)

### getModel

    public Model getModel()

  Return the `Model` to which this Construct belongs

### getSchemaObjects

    public SchemaObject[] getSchemaObjects()
                                    throws IntegrityException

  Find all `SchemaObjects` that are instances of a particular Construct. Useful when it is necessary to find all occurances of a data modelling language in use, and to find objects when deleting a data modelling language.

    `IntegrityException`

### importSchemes

    public void importSchemes(java.io.InputStream is)
                       throws java.io.IOException,
                              SyntaxException

    `java.io.IOException`
    `SyntaxException`

### exportSchemes

    public void exportSchemes(java.io.OutputStream os)

### exportSchemes

    public void exportSchemes(java.io.PrintWriter pw)

### write

    public void write(java.io.OutputStream os)

### write

    public void write(java.io.PrintWriter pw)

### getForegroundColor

    public java.awt.Color getForegroundColor()

  Return the default foreground colour to be used from drawing `SchemaObject`s of this `Construct`.

  Returns:
    A `Color`, or null if no default colour is set for this `Construct` nor its `Model`

### setForegroundColor

    public void setForegroundColor(java.awt.Color c)

  Set the default foreground colour to be used from drawing `SchemaObject`s of this `Construct`.

### getBackgroundColor

    public java.awt.Color getBackgroundColor()

  Return the default background colour to be used from drawing `SchemaObject`s of this `Construct`.

  Returns:
    A `Color`, or null if no default colour is set for this `Construct` nor its `Model`

### setBackgroundColor

    public void setBackgroundColor(java.awt.Color c)

  Set the default background colour to be used from drawing `SchemaObject`s of this `Construct`.

### getTextColor

    public java.awt.Color getTextColor()

  Return the default text colour to be used from drawing `SchemaObject`s of this `Construct`.

  Returns:
    A `Color`, or null if no default colour is set for this `Construct` nor its `Model`

### setTextColor

    public void setTextColor(java.awt.Color c)

  Set the default text colour to be used from drawing `SchemaObject`s of this `Construct`.

### getConstraintDefinition

    public java.lang.String getConstraintDefinition(java.lang.String constraint_name)
                                             throws NotFoundException

  Return the definition of a constraint used within this `Construct`.

  Parameters:
    `constraint_name` - A string that may appear as a constraint in this construct
  Returns:
    A `String` constaining an IQL definition of the constraint named in this `Construct`
  Throws:
    `NotFoundException` - if no definition for constraint_name is held in the repository

### setConstraintDefinition

    public void setConstraintDefinition(java.lang.String constraint_name,
                                        java.lang.String constraint_definition)

  Set the definition of a constraint used within this `Construct`.

  Parameters:
    `constraint_name` - A string that may appear as a constraint in this construct
    `constraint_definition` - `String` constaining an IQL definition of the constraint named in this `Construct`.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD