|
|||||||||
| 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
Model which is set up
when the model is initialised. The HDM type hierarchy acts as a CTH
It is created if inter model transformations are performed. High level
types and equivalences are added to it to form an intermodel type hierarchy.
Using the notation from the technical report.| Nested Class Summary | |
|---|---|
class |
TypeHierarchy.TypeObject
The type object class This class stored information about type objects in a type hierarchy Using the notation in the technical reports on types: hdmEquiv is =, parentName is < |
| Field Summary | |
|---|---|
static java.lang.String |
HDM_TYPE_ANY
|
static java.lang.String |
HDM_TYPE_BOOL
|
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 modelId)
Creates a new instance of typeHierarchy for serialisation |
|
| Method Summary | |
|---|---|
static TypeHierarchy |
addAllTypesToHierarchy(TypeHierarchy th)
Load ALL types for this type hierarchy. |
TypeHierarchy.TypeObject |
addTypeToHierarchy(int tid,
java.lang.String typeName,
int hdmEquiv,
int pid)
Add a type from the repository to the hierarchy |
TypeHierarchy.TypeObject |
addTypeToHierarchy(java.lang.String typeName,
java.lang.String parentTypeName,
java.lang.String baseType)
Add a new type to the hierarchy and the repository. |
void |
assertType(java.lang.String typeName,
java.lang.String parentTypeName)
Make sure @param typeName is in the type hierarchy. |
boolean |
castType(int sourceTid,
int targetTid)
This method attempts to cast a type to one higher in the type hierarchy. |
static void |
createTypeHierarchies()
Load all the type information for all models into a static hashMap This method is called once when the system is started into the types hash map |
PersistentKey |
getKey()
Implements the PersistentObject interface |
TypeHierarchy.TypeObject |
getParentType(java.lang.String typeName)
Retrieve the parent TypeHierarchy.TypeObject object of @param typeName from this hierarchy |
java.util.Map |
getPersistentAttributes()
Implements the PersistentObject interface |
TypeHierarchy.TypeObject |
getType(int tid)
Retrieve a specific TypeHierarchy.TypeObject object from this hierarchy by tid |
TypeHierarchy.TypeObject |
getType(java.lang.String typeName)
Retrieve a specific TypeHierarchy.TypeObject object from this hierarchy |
static TypeHierarchy |
getTypeHierarchy(int mid)
Get the type hierarchy identified by mid or create one if none exits |
int |
getTypeHierarchyId()
Get the unique identifier for this TypeHierarchy object This is the model id of the Model this hierarchy is attached to |
static int |
getTypeID(int mid,
java.lang.String typeName)
|
java.util.List |
getTypeObjects()
Get all the type objects this TypeHierarchy object |
java.lang.String |
hdmToHighLevelTypeLookup(java.lang.String hdmTypeName)
Method to return the high level type in model @param mid equivalent to the HDM type @param hdmTypeName |
java.lang.String |
highLevelToHDMTypeLookup(int tid)
Method to return the name of the HDM type equivalent to to the high level type @param tid |
TypeHierarchy |
mergeTypeHierarchy(TypeHierarchy cth)
Merge a high level type hierarchy with the HDM CTH |
| 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_BOOL
public static final java.lang.String HDM_TYPE_FLOAT
public static final java.lang.String HDM_TYPE_OID
| Constructor Detail |
|---|
public TypeHierarchy(int modelId)
| Method Detail |
|---|
public static void createTypeHierarchies()
public static TypeHierarchy addAllTypesToHierarchy(TypeHierarchy th)
throws NotFoundException
Model
List a ArrayList object of types to maintain order
NotFoundException
public void assertType(java.lang.String typeName,
java.lang.String parentTypeName)
throws NotFoundException
NotFoundException
public TypeHierarchy.TypeObject addTypeToHierarchy(int tid,
java.lang.String typeName,
int hdmEquiv,
int pid)
throws NotFoundException
tid - - The type id of the typetypeName - - The name of the new typehdmEquiv - - The id of the equivalent HDM type to this typeparentTypeName - - The name of the parent of this type in this model's hierarchy
NotFoundException
public TypeHierarchy.TypeObject addTypeToHierarchy(java.lang.String typeName,
java.lang.String parentTypeName,
java.lang.String baseType)
throws NotFoundException
typeName - - The name of the new typeparentTypeName - - The name of the parent of this type in this model's hierarchybaseType - - The name of the base type in the CTH this type is related to
NotFoundException
public static TypeHierarchy getTypeHierarchy(int mid)
throws NotFoundException
mid - - the type hierarchy identifier
NotFoundException
public TypeHierarchy.TypeObject getType(java.lang.String typeName)
throws NotFoundException
TypeHierarchy.TypeObject object from this hierarchy
NotFoundException
public static int getTypeID(int mid,
java.lang.String typeName)
throws NotFoundException
NotFoundException
public TypeHierarchy.TypeObject getType(int tid)
throws NotFoundException
TypeHierarchy.TypeObject object from this hierarchy by tid
NotFoundException
public TypeHierarchy.TypeObject getParentType(java.lang.String typeName)
throws NotFoundException
TypeHierarchy.TypeObject object of @param typeName from this hierarchy
NotFoundException
public java.util.List getTypeObjects()
throws NotFoundException
NotFoundException
public int getTypeHierarchyId()
throws NotFoundException
Model this hierarchy is attached to
NotFoundException
public TypeHierarchy mergeTypeHierarchy(TypeHierarchy cth)
throws NotFoundException
NotFoundException
public boolean castType(int sourceTid,
int targetTid)
throws AutoMedException
sourceTid - - The id of the source typetargetTid - - The id of the target type
AutoMedException
public java.lang.String hdmToHighLevelTypeLookup(java.lang.String hdmTypeName)
throws NotFoundException
hdmTypeName - - The HDM type
NotFoundException
public java.lang.String highLevelToHDMTypeLookup(int tid)
throws NotFoundException
tid - - The high level type id
NotFoundExceptionpublic java.util.Map getPersistentAttributes()
PersistentObject interface
getPersistentAttributes in interface PersistentObjectPersistentObject.getPersistentAttributes()public PersistentKey getKey()
PersistentObject interface
getKey in interface PersistentObjectuk.ac.ic.doc.automed.wrappersPersistentObject#getKey()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||