|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.ac.ic.doc.automed.reps.TypeHierarchy
public class TypeHierarchy
| Field Summary | |
|---|---|
static java.lang.String |
HDM_TYPE_ANY
|
static java.lang.String |
HDM_TYPE_FLOAT
|
static java.lang.String |
HDM_TYPE_INTEGER
|
static java.lang.String |
HDM_TYPE_NUMERIC
|
static java.lang.String |
HDM_TYPE_OID
|
static java.lang.String |
HDM_TYPE_STRING
|
| Constructor Summary | |
|---|---|
TypeHierarchy(int mid,
java.lang.String name,
int hdmEquiv,
int parentType)
Creates a new instance of typeHierarchy for serialisation |
|
TypeHierarchy(int mid,
java.lang.String name,
java.lang.String modelName,
int hdmEquiv,
int parentType)
|
|
| Method Summary | |
|---|---|
static void |
assertType(int mid,
java.lang.String typeName)
This method checks whether @param typeName exists in the type hierarchy for Model @param mid and if not it creates it |
boolean |
castType(int sourceTid,
int targetTid)
This method attempts to cast a type to one higher in the type hierarchy. |
static int |
createType(int modelID,
java.lang.String typeName,
int hdmEquiv,
int parentType)
Create a new TypeHierarchy object in the database |
int |
getHDMEquiv()
Get the type id of the HDM equivalent of this type |
PersistentKey |
getKey()
Implements the PersistentObject interface |
int |
getMID()
Get the id of the model the type comes from |
java.lang.String |
getModelName()
|
java.lang.String |
getName()
Get the name of the type |
int |
getParent()
Get the type id of the parent of this type |
java.util.Map |
getPersistentAttributes()
Implements the PersistentObject interface |
static TypeHierarchy |
getType(int tid)
Get the type object identified by tid |
static TypeHierarchy |
getType(java.lang.String modelName,
java.lang.String typeName)
Retrieve a TypeHierarchy object from database based on name and model |
int |
getTypeId()
Get the type of this object |
static int |
getTypeId(int mid,
java.lang.String typeName)
Get the type object identified by tid |
static TypeHierarchy[] |
getTypes()
Returns an array of all types. |
static java.lang.String |
hdmToHighLevelTypeLookup(int mid,
java.lang.String hdmTypeName)
Method to return the high level type in model @param mid equivalent to the HDM type @param hdmTypeName |
static java.lang.String |
highLevelToHDMTypeLookup(int tid)
Method to return the HDM type equivalent to to the high level type @param tid |
static java.util.List |
loadAllTypes()
Load ALL types. |
static void |
loadTypes()
Load all the type information from the repository into the types hash map |
static java.util.List |
loadTypes(java.lang.String modelName)
Load types for a specific model |
void |
setHDMEquivName(java.lang.String hdmName)
|
void |
setTypeId(int tid)
|
static void |
setupEquivalences(int mid,
java.lang.String typeName,
java.lang.String hdmTypeName,
java.lang.String parentTypeName)
Create a new type and set up the type equivalences between hdm and the model this type belongs to |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String HDM_TYPE_ANY
public static final java.lang.String HDM_TYPE_STRING
public static final java.lang.String HDM_TYPE_NUMERIC
public static final java.lang.String HDM_TYPE_INTEGER
public static final java.lang.String HDM_TYPE_FLOAT
public static final java.lang.String HDM_TYPE_OID
| Constructor Detail |
|---|
public TypeHierarchy(int mid,
java.lang.String name,
int hdmEquiv,
int parentType)
throws AutoMedException
AutoMedException
public TypeHierarchy(int mid,
java.lang.String name,
java.lang.String modelName,
int hdmEquiv,
int parentType)
throws AutoMedException
AutoMedException| Method Detail |
|---|
public static void loadTypes()
public static java.util.List loadTypes(java.lang.String modelName)
throws AutoMedException
modelName - The name of the Model object as an alternative key
List an ArrayList object of types (tid --> object)
AutoMedException
public static java.util.List loadAllTypes()
throws AutoMedException
Model
List a ArrayList object of types to maintain order
AutoMedException
public java.lang.String getName()
throws NotFoundException
NotFoundException
public int getMID()
throws NotFoundException
NotFoundException
public int getParent()
throws NotFoundException
NotFoundException
public int getHDMEquiv()
throws NotFoundException
NotFoundException
public static TypeHierarchy getType(int tid)
throws NotFoundException
tid - - the type identifier
NotFoundException
public static int getTypeId(int mid,
java.lang.String typeName)
throws NotFoundException
tid - - the type identifier
NotFoundExceptionpublic int getTypeId()
public void setTypeId(int tid)
public void setHDMEquivName(java.lang.String hdmName)
public java.lang.String getModelName()
public static TypeHierarchy getType(java.lang.String modelName,
java.lang.String typeName)
throws NotFoundException
TypeHierarchy object from database based on name and model
NotFoundExceptionpublic static TypeHierarchy[] getTypes()
public boolean castType(int sourceTid,
int targetTid)
throws AutoMedException
sourceTid - - The id of the source typetargetTid - - The id of the target type
AutoMedException
public static void assertType(int mid,
java.lang.String typeName)
throws NotFoundException
mid - - The id of the model this type comes from
NotFoundException
public static java.lang.String hdmToHighLevelTypeLookup(int mid,
java.lang.String hdmTypeName)
mid - - The model idhdmTypeName - - The HDM typepublic static java.lang.String highLevelToHDMTypeLookup(int tid)
tid - - The high level type id
public static void setupEquivalences(int mid,
java.lang.String typeName,
java.lang.String hdmTypeName,
java.lang.String parentTypeName)
mid - - The id of the model this type belongs totypeName - - The name of the new typehdmTypeId - - The id of the equivalent HDM type to this typeparentTypeName - - The name of the parent of this type in this model's hierarchy
public static int createType(int modelID,
java.lang.String typeName,
int hdmEquiv,
int parentType)
throws NotFoundException
TypeHierarchy object in the database
NotFoundExceptionpublic 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 | ||||||||