model
Class OntologyObject

java.lang.Object
  extended by model.OntologyObject
Direct Known Subclasses:
AbstractObject, ConstructedObject, SpatialRelation

public class OntologyObject
extends java.lang.Object

This is the base class for all objects listed in a map. Note: not all ontology objects contain a graphical representation, therefore it is necessary that a graphical representation exists before modifying the graphics.


Field Summary
private  java.util.HashMap<java.lang.String,Attribute> attributes
          the object properties
private  GraphicalObject graphics
          the graphics of the object
private  java.util.ArrayList<java.lang.String> hierarchy
          the inheritance hierarchy of the object
private  java.util.ArrayList<History> history
          the history of the object
private  long ID
          a unique identifier
 
Constructor Summary
OntologyObject(long ID, java.util.ArrayList<java.lang.String> hierarchy, java.util.HashSet<Attribute> attributes)
          Constructs an ontology object.
 
Method Summary
 Attribute getAttribute(java.lang.String attribute)
          Gets the attribute object for the specied attribute name.
 java.util.Set<java.lang.String> getAttributes()
          Gets the names of the attributes.
 java.lang.String getAttributeValue(java.lang.String attribute)
          Gets the value of an attribute.
 int getDepth()
          Gets the depth of the object.
 GraphicalObject getGraphics()
          Gets the graphics for the object.
 java.util.ArrayList<History> getHistory()
          Gets the object history.
 java.lang.Long getID()
          Gets the object unique identifier.
 java.lang.String getType()
          Gets the object type.
 boolean instanceOf(java.lang.String type)
          Checks if the object is an instance of the specified type.
 boolean isMoveable()
          Gets if the object is moveable.
 void setAttribute(java.lang.String attribute, java.lang.String value)
          Sets the value of attribute.
 void setAttributes(java.util.Collection<Attribute> attributes)
           
 void setGraphics(GraphicalObject graphics)
          Sets the object graphics.
 void setHierarchy(java.util.ArrayList<java.lang.String> hierarchy)
          Sets the object hierarchy.
 void setHistory(java.util.ArrayList<History> history)
          Sets the object history.
 void setSelected(boolean selected)
          Sets the object as selected.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

private long ID
a unique identifier


hierarchy

private java.util.ArrayList<java.lang.String> hierarchy
the inheritance hierarchy of the object


attributes

private java.util.HashMap<java.lang.String,Attribute> attributes
the object properties


history

private java.util.ArrayList<History> history
the history of the object


graphics

private GraphicalObject graphics
the graphics of the object

Constructor Detail

OntologyObject

public OntologyObject(long ID,
                      java.util.ArrayList<java.lang.String> hierarchy,
                      java.util.HashSet<Attribute> attributes)
Constructs an ontology object.

Parameters:
ID - - a unique identifier
hierarchy - - the inheritance hierarchy of the object
attributes - - the object properties
Method Detail

setHierarchy

public void setHierarchy(java.util.ArrayList<java.lang.String> hierarchy)
Sets the object hierarchy.

Parameters:
hierarchy - - the hierarchy

instanceOf

public boolean instanceOf(java.lang.String type)
Checks if the object is an instance of the specified type.

Parameters:
type - - the class name
Returns:
true if the object if the specified type

isMoveable

public boolean isMoveable()
Gets if the object is moveable.


getDepth

public int getDepth()
Gets the depth of the object. If no depth is specified, then a depth of 1 is returned.


setSelected

public void setSelected(boolean selected)
Sets the object as selected.


getHistory

public java.util.ArrayList<History> getHistory()
Gets the object history.


setGraphics

public void setGraphics(GraphicalObject graphics)
Sets the object graphics.


getGraphics

public GraphicalObject getGraphics()
Gets the graphics for the object.


setHistory

public void setHistory(java.util.ArrayList<History> history)
Sets the object history.


getType

public java.lang.String getType()
Gets the object type.


getID

public java.lang.Long getID()
Gets the object unique identifier.


getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attribute)
Gets the value of an attribute.


getAttribute

public Attribute getAttribute(java.lang.String attribute)
Gets the attribute object for the specied attribute name.


setAttributes

public void setAttributes(java.util.Collection<Attribute> attributes)
Parameters:
attributes -

getAttributes

public java.util.Set<java.lang.String> getAttributes()
Gets the names of the attributes.


setAttribute

public void setAttribute(java.lang.String attribute,
                         java.lang.String value)
Sets the value of attribute.

Parameters:
attribute - - the attribute name
value - - the new attribute value