|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttranslate.MapImporter
public class MapImporter
Class for loading an object model from an XML file and loading a map from an XML file.
Field Summary | |
---|---|
private java.lang.String |
ABSTRACT_OBJECT
|
private java.util.HashSet<java.lang.String> |
abstractTypes
abstract object classes |
private java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
classAttributes
attributes for each class |
private java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> |
classHierarchy
inheritance lists for each class |
private java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> |
classProperties
properties for each class |
private java.util.HashMap<java.lang.String,java.lang.String> |
classVariables
a mapping of class variables to default values |
private java.lang.String |
CONSTRUCTED_OBJECT
|
private long |
ID_COUNTER
used for assigning unique identifiers |
private java.util.HashSet<java.lang.String> |
objectTypes
constructed object classes |
(package private) java.util.ArrayList<RelationValue> |
relations
the relation values |
private java.util.HashSet<java.lang.String> |
relationTypes
spatial relation classes |
private java.lang.String |
SPATIAL_RELATION
|
Constructor Summary | |
---|---|
MapImporter(java.lang.String ontologyFile)
Loads the object model from a specified file. |
Method Summary | |
---|---|
void |
convertType(OntologyObject object,
java.lang.String className)
Converts the specified object into the new type. |
OntologyObject |
copy(OntologyObject object)
Creates a copy of the specified object. |
private java.util.HashSet<Attribute> |
getAttributes(org.w3c.dom.Element element)
Gets the attributes of an instance of a class. |
java.util.ArrayList<java.lang.String> |
getConstructableRelationTypes()
Gets a list of spatial relation classes that are instantiable. |
java.util.ArrayList<java.lang.String> |
getConstructedObjectTypes()
Gets a list of constructed object classes in the object model. |
private GraphicalObject |
getGraphics(org.w3c.dom.Element element)
Gets the graphics for an object. |
private java.util.ArrayList<History> |
getHistory(org.w3c.dom.Element element)
Gets the history of an object. |
java.util.ArrayList<RelationValue> |
getRelations()
Gets the relation values. |
java.util.ArrayList<java.lang.String> |
getRelationTypes()
Gets a list of spatial relation classes in the object model. |
Map |
importMap(java.lang.String mapFile)
Imports a map from an XML file |
OntologyObject |
newInstance(java.lang.String className,
long id)
Constructs a new ontology object. |
void |
setRelations(java.util.ArrayList<RelationValue> relations)
Sets the relation values. |
private void |
traverseElement(org.w3c.dom.Element element,
java.util.ArrayList<java.lang.String> hierarchy,
java.util.HashSet<java.lang.String> types,
java.util.ArrayList<java.lang.String> properties)
Recursive method for traversing through the classes in the object model. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String ABSTRACT_OBJECT
private java.lang.String CONSTRUCTED_OBJECT
private java.lang.String SPATIAL_RELATION
private java.util.HashSet<java.lang.String> objectTypes
private java.util.HashSet<java.lang.String> relationTypes
private java.util.HashSet<java.lang.String> abstractTypes
private java.util.HashMap<java.lang.String,java.lang.String> classVariables
private java.util.HashMap<java.lang.String,java.util.HashMap<java.lang.String,java.lang.String>> classProperties
private java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> classHierarchy
private java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> classAttributes
java.util.ArrayList<RelationValue> relations
private long ID_COUNTER
Constructor Detail |
---|
public MapImporter(java.lang.String ontologyFile) throws java.lang.Exception
ontologyFile
- - the ontology file
java.lang.Exception
- - Exceptions that occur from parsing the modelMethod Detail |
---|
private void traverseElement(org.w3c.dom.Element element, java.util.ArrayList<java.lang.String> hierarchy, java.util.HashSet<java.lang.String> types, java.util.ArrayList<java.lang.String> properties)
element
- - the DOM elementhierarchy
- - the list of the inheritance hierarchytypes
- - the class names belonging to the base inheritance classpublic Map importMap(java.lang.String mapFile) throws java.lang.Exception
mapFile
- - the map XML file
java.lang.Exception
- - Exceptions that occur from parsing the mapprivate java.util.ArrayList<History> getHistory(org.w3c.dom.Element element)
element
- - the DOM element
private java.util.HashSet<Attribute> getAttributes(org.w3c.dom.Element element)
element
- - the DOM element
private GraphicalObject getGraphics(org.w3c.dom.Element element)
element
- - the DOM element
public OntologyObject newInstance(java.lang.String className, long id)
className
- - the class name of the new objectid
- - the identifier to assign the object
public OntologyObject copy(OntologyObject object)
object
- - the object to copy
public void convertType(OntologyObject object, java.lang.String className)
object
- className
- public void setRelations(java.util.ArrayList<RelationValue> relations)
public java.util.ArrayList<RelationValue> getRelations()
public java.util.ArrayList<java.lang.String> getConstructableRelationTypes()
public java.util.ArrayList<java.lang.String> getRelationTypes()
public java.util.ArrayList<java.lang.String> getConstructedObjectTypes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |