uk.ac.ic.doc.automed.reps
Class ConstructScheme

java.lang.Object
  extended by uk.ac.ic.doc.automed.reps.ConstructScheme
All Implemented Interfaces:
PersistentObject

public class ConstructScheme
extends java.lang.Object
implements PersistentObject

Edited by mdle on 20/10/2005 to implement the PersistentObject interface


Constructor Summary
protected ConstructScheme(int cid, int pos, int schemeType, Construct con, boolean key, int HDMType, int lowerBound, int upperBound)
          Instantiates a new ConstructScheme object.
 
Method Summary
 java.lang.String getArgCID()
           
 Construct getArgConstruct()
          Returns the Construct type of the ConstructScheme.
 int getCID()
          Other setter, getter methods
 int getHDMType()
          Returns the HDM type of the ConstructScheme.
static java.lang.String getHDMTypeString(int HDMType)
           
static java.lang.String getHDMTypeString(int HDMType, boolean brief)
           
 PersistentKey getKey()
          Implements PersistentObject interface Added by mdle on 20/10/2005
 int getLower()
          Returns the lower bound indicating the minimum occurence of the ConstructScheme.
 java.util.Map getPersistentAttributes()
          Implements PersistentObject interface Added by mdle on 20/10/2005
 int getSchemePos()
           
 int getSchemeType()
          Returns the scheme type of the ConstructScheme.
static java.lang.String getSchemeTypeString(int schemeType)
           
static java.lang.String getSchemeTypeString(int schemeType, boolean brief)
           
 int getUpper()
          Returns the upper bound indicating the maximum occurence of the ConstructScheme.
 boolean inRange(int c)
          Determine if a certain number of instances of elements in a scheme matching this ConstructScheme are permissable.
 boolean isKey()
          Returns whether of not the ConstructScheme is part the key of the whole scheme.
 void setArgCID(java.lang.String argCID)
          Added to set the argCID value independently when loading models dmle 9/11/2005
 void setArgConstruct(Construct con)
          Sets the Construct in the ConstructScheme.
 void setHDMType(int HDMType)
          Sets the HDM type of the ConstructScheme.
 void setKey(boolean key)
          Sets whether or not the current scheme position is part the key of the whole scheme.
 void setLower(int lowerBound)
          Sets the lower bound indicating the minimum occurence of the ConstructScheme.
 void setSchemeType(int schemeType)
          Sets the scheme type of the ConstructScheme.
 void setUpper(int upperBound)
          Sets the upper bound indicating the maximum occurence of the ConstructScheme.
 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, toString, wait, wait, wait
 

Constructor Detail

ConstructScheme

protected ConstructScheme(int cid,
                          int pos,
                          int schemeType,
                          Construct con,
                          boolean key,
                          int HDMType,
                          int lowerBound,
                          int upperBound)
Instantiates a new ConstructScheme object. Each Construct has in its scheme one or more ConstructScheme objects.

Parameters:
sType - scheme type of the ConstructScheme.
con - reference to the construct if the scheme position being created contains a Construct. Set to null otherwise.
key - set to true if the sheme position being created forms the key or part of the key of the position's underlying construct; false otherwise.
HDMType - the corresponding HDM type of the construct scheme at the current scheme position.
lowerBound - minimum occurrence of the scheme argument.
upperBound - maximum occurrence of the scheme argument. If upperBound is less than lowerBound then their is no upper bound.
See Also:
Construct
Method Detail

getSchemeType

public int getSchemeType()
Returns the scheme type of the ConstructScheme.

Returns:
the scheme type of the ConstructScheme.

getArgConstruct

public Construct getArgConstruct()
Returns the Construct type of the ConstructScheme. If the scheme type of the ConstructScheme is Scheme.TYPE_NAME, this field should be set to null

Returns:
the type of Construct of the ConstructScheme. Returns null if the ConstructScheme is of scheme type Scheme.TYPE_NAME.

isKey

public boolean isKey()
Returns whether of not the ConstructScheme is part the key of the whole scheme.

Returns:
true if the current scheme position is part the key of the whole scheme; false otherwise.

getHDMType

public int getHDMType()
Returns the HDM type of the ConstructScheme.

Returns:
the HDM type of the ConstructScheme.

getLower

public int getLower()
Returns the lower bound indicating the minimum occurence of the ConstructScheme.

Returns:
the lower bound indicating the minimum occurence of the ConstructScheme.

getUpper

public int getUpper()
Returns the upper bound indicating the maximum occurence of the ConstructScheme.

Returns:
the upper bound indicating the maximum occurence of the ConstructScheme.

setSchemeType

public void setSchemeType(int schemeType)
                   throws MDRException,
                          java.sql.SQLException,
                          DSRException,
                          java.io.IOException
Sets the scheme type of the ConstructScheme.

Parameters:
schemeType - the scheme type of the ConstructScheme.
Throws:
MDRException
java.sql.SQLException
DSRException
java.io.IOException

setArgConstruct

public void setArgConstruct(Construct con)
                     throws MDRException,
                            java.sql.SQLException,
                            DSRException,
                            java.io.IOException
Sets the Construct in the ConstructScheme. If the scheme type of ConstructScheme is Scheme.TYPE_NAME, this field should be set to null.

Parameters:
con - the Construct in the ConstructScheme.
Throws:
MDRException
java.sql.SQLException
DSRException
java.io.IOException

setArgCID

public void setArgCID(java.lang.String argCID)
Added to set the argCID value independently when loading models dmle 9/11/2005


setKey

public void setKey(boolean key)
            throws MDRException,
                   java.sql.SQLException,
                   DSRException,
                   java.io.IOException
Sets whether or not the current scheme position is part the key of the whole scheme.

Parameters:
key - set to true if the current scheme position is part the key of the whole scheme; false otherwise.
Throws:
MDRException
java.sql.SQLException
DSRException
java.io.IOException

setHDMType

public void setHDMType(int HDMType)
                throws MDRException,
                       java.sql.SQLException,
                       DSRException,
                       java.io.IOException
Sets the HDM type of the ConstructScheme.

Parameters:
HDMType - the HDM type of the ConstructScheme.
Throws:
MDRException
java.sql.SQLException
DSRException
java.io.IOException

setLower

public void setLower(int lowerBound)
              throws MDRException,
                     java.sql.SQLException,
                     DSRException,
                     java.io.IOException
Sets the lower bound indicating the minimum occurence of the ConstructScheme.

Parameters:
lowerBound - the lower bound indicating the minimum occurence of the ConstructScheme.
Throws:
MDRException
java.sql.SQLException
DSRException
java.io.IOException

setUpper

public void setUpper(int upperBound)
              throws MDRException,
                     java.sql.SQLException,
                     DSRException,
                     java.io.IOException
Sets the upper bound indicating the maximum occurence of the ConstructScheme.

Parameters:
upperBound - the upper bound indicating the maximum occurence of the ConstructScheme.
Throws:
MDRException
java.sql.SQLException
DSRException
java.io.IOException

getHDMTypeString

public static java.lang.String getHDMTypeString(int HDMType)

getHDMTypeString

public static java.lang.String getHDMTypeString(int HDMType,
                                                boolean brief)

getSchemeTypeString

public static java.lang.String getSchemeTypeString(int schemeType)

getSchemeTypeString

public static java.lang.String getSchemeTypeString(int schemeType,
                                                   boolean brief)

inRange

public boolean inRange(int c)
Determine if a certain number of instances of elements in a scheme matching this ConstructScheme are permissable.

Parameters:
c - number of instances of elements to check
Returns:
true is c is in the permitted range

write

public void write(java.io.OutputStream os)

write

public void write(java.io.PrintWriter pw)

getCID

public int getCID()
Other setter, getter methods


getSchemePos

public int getSchemePos()

getArgCID

public java.lang.String getArgCID()

getKey

public PersistentKey getKey()
Implements PersistentObject interface Added by mdle on 20/10/2005

Specified by:
getKey in interface PersistentObject
See Also:
PersistentObject.getKey()

getPersistentAttributes

public java.util.Map getPersistentAttributes()
Implements PersistentObject interface Added by mdle on 20/10/2005

Specified by:
getPersistentAttributes in interface PersistentObject
See Also:
PersistentObject.getPersistentAttributes()