Package jadex.rules.state
Class OAVTypeModel
- java.lang.Object
- 
- jadex.rules.state.OAVTypeModel
 
- 
 public class OAVTypeModel extends java.lang.ObjectA type model contains all known types. Type models must be associated with a state which uses the type model to ensure that no objects of undefined types are defined.
- 
- 
Field SummaryFields Modifier and Type Field Description protected java.lang.ClassLoaderclassloaderThe class loader.protected java.lang.StringnameThe model name.protected static java.lang.Class[]PCLThe argument types for property change listener adding/removal (cached for speed).protected OAVTypeModel[]tmodelsThe contained type models.protected java.util.MaptypesAll object types (name -> type).
 - 
Constructor SummaryConstructors Constructor Description OAVTypeModel(java.lang.String name)Create a new model.OAVTypeModel(java.lang.String name, java.lang.ClassLoader classloader)Create a new model.OAVTypeModel(java.lang.String name, java.lang.ClassLoader classloader, OAVTypeModel[] subtypemodels)Create a new model.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTypeModel(OAVTypeModel tmodel)Adds a type model to the state.booleancontains(OAVObjectType type)Test if a type is contained.OAVJavaTypecreateJavaType(java.lang.Class clazz, java.lang.String kind)Create a Java type.OAVObjectTypecreateType(java.lang.String name)Create a type.OAVObjectTypecreateType(java.lang.String name, OAVObjectType supertype)Create a type.booleanequals(java.lang.Object object)Test if two types are equal.java.lang.ClassLoadergetClassLoader()Get the class loader.protected OAVObjectTypegetDeepType(java.lang.String typename)Search for a type in this model and all submodels.OAVTypeModelgetDirectTypeModel()Get a copy of the typemodel without contained models.OAVJavaTypegetJavaType(java.lang.Class clazz)Get a type for a java class.java.lang.StringgetName()Get the name.OAVObjectTypegetObjectType(java.lang.Class clazz)Get a type per name.OAVObjectTypegetObjectType(java.lang.String typename)Get a type per name.OAVTypeModel[]getTypeModels()Get the contained typemodels.inthashCode()Get the hash code.booleanremoveType(OAVObjectType type)Remove an existing type.voidsetClassLoader(java.lang.ClassLoader classloader)Set the classloader.
 
- 
- 
- 
Field Detail- 
PCLprotected static java.lang.Class[] PCL The argument types for property change listener adding/removal (cached for speed).
 - 
nameprotected java.lang.String name The model name.
 - 
typesprotected java.util.Map types All object types (name -> type).
 - 
tmodelsprotected OAVTypeModel[] tmodels The contained type models.
 - 
classloaderprotected java.lang.ClassLoader classloader The class loader.
 
- 
 - 
Constructor Detail- 
OAVTypeModelpublic OAVTypeModel(java.lang.String name) Create a new model.- Parameters:
- name- The name.
 
 - 
OAVTypeModelpublic OAVTypeModel(java.lang.String name, java.lang.ClassLoader classloader)Create a new model.- Parameters:
- name- The name.
 
 - 
OAVTypeModelpublic OAVTypeModel(java.lang.String name, java.lang.ClassLoader classloader, OAVTypeModel[] subtypemodels)Create a new model.- Parameters:
- name- The name.
 
 
- 
 - 
Method Detail- 
createTypepublic OAVObjectType createType(java.lang.String name) Create a type. Creates a type that can be used to create objects.- Parameters:
- name- The type name.
- Returns:
- The type.
 
 - 
createTypepublic OAVObjectType createType(java.lang.String name, OAVObjectType supertype) Create a type. Creates a type that can be used to create objects.- Parameters:
- name- The type name.
- supertype- The supertype.
- Returns:
- The type.
 
 - 
createJavaTypepublic OAVJavaType createJavaType(java.lang.Class clazz, java.lang.String kind) Create a Java type.- Parameters:
- clazz- The java class.
- kind- The kind of type as defined in OAVJavaType.
- Returns:
- The new type.
 
 - 
removeTypepublic boolean removeType(OAVObjectType type) Remove an existing type. Deletes the type from the state.- Parameters:
- type- The object type.
- Returns:
- True, if could be removed.
 
 - 
addTypeModelpublic void addTypeModel(OAVTypeModel tmodel) Adds a type model to the state.- Parameters:
- tmodel- The type model.
 
 - 
containspublic boolean contains(OAVObjectType type) Test if a type is contained.- Parameters:
- type- The type.
- Returns:
- True, if type is part of type model.
 
 - 
getObjectTypepublic OAVObjectType getObjectType(java.lang.Class clazz) Get a type per name. Creates implicit java types on the fly. TODO: Unify with getObjectType(String typename)- Parameters:
- typename- The type name.
- Returns:
- The type if contained.
- Throws:
- java.lang.RuntimeException- when the type is not found.
 
 - 
getObjectTypepublic OAVObjectType getObjectType(java.lang.String typename) Get a type per name. Creates implicit java types on the fly. TODO: Unify with getObjectType(Class clazz)- Parameters:
- typename- The type name.
- Returns:
- The type if contained.
- Throws:
- java.lang.RuntimeException- when the type is not found.
 
 - 
getNamepublic java.lang.String getName() Get the name.- Returns:
- The name.
 
 - 
getClassLoaderpublic java.lang.ClassLoader getClassLoader() Get the class loader.- Returns:
- The class loader.
 
 - 
setClassLoaderpublic void setClassLoader(java.lang.ClassLoader classloader) Set the classloader.- Parameters:
- classloader- The classloader to set.
 
 - 
equalspublic boolean equals(java.lang.Object object) Test if two types are equal.- Overrides:
- equalsin class- java.lang.Object
- Returns:
- True if equal.
 
 - 
hashCodepublic int hashCode() Get the hash code.- Overrides:
- hashCodein class- java.lang.Object
- Returns:
- The hashcode.
 
 - 
getJavaTypepublic OAVJavaType getJavaType(java.lang.Class clazz) Get a type for a java class.
 - 
getTypeModelspublic OAVTypeModel[] getTypeModels() Get the contained typemodels.
 - 
getDirectTypeModelpublic OAVTypeModel getDirectTypeModel() Get a copy of the typemodel without contained models.
 - 
getDeepTypeprotected OAVObjectType getDeepType(java.lang.String typename) Search for a type in this model and all submodels.- Returns:
- null if not found.
 
 
- 
 
-