|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.uppaal.model.core2.Element
public class Element
Base class for elements. An element has a set of named properties. A prototype based inheritance mechanism is used. If properties cannot be be resolved directly, the prototype is consulted. This is important to remember when setting properties on properties: If you obtain a property A with getProperty() of an element E and then use setProperty() on A to set another property B, then it might be the case that A was in fact a property of the prototype! Elements have a parent, although they do not themself have the necessary machinery to be arranged in a tree structure. For that the Node class should be used instead. Finally, elements support the basic infrastructure to register listeners (observers).
| Field Summary | |
|---|---|
List<EventListener> |
listeners
|
protected Map<String,Property> |
properties
The properties of this element. |
Element |
prototype
The prototype of this element. |
| Constructor Summary | |
|---|---|
Element(Element prototype)
|
|
| Method Summary | |
|---|---|
void |
accept(Visitor visitor)
Accept a visitor. |
void |
acceptSafe(Visitor visitor)
Like to accept(), but cannot throw an Exception. |
void |
addListener(EventListener l)
Adds an event listener. |
Object |
clone()
Returns a deep clone of the element. |
Color |
getColor()
Returns the value of the color property. |
Document |
getDocument()
Returns the document of this element. |
Property |
getLocalProperty(String name)
Returns the property of the given name. |
Element |
getParent()
Returns the parent element. |
Set<Map.Entry<String,Property>> |
getProperties()
Get the properties stored in this element. |
Property |
getProperty(String name)
Returns the property of the given name. |
Object |
getPropertyValue(String name)
Returns the value of the property of the given name. |
Element |
getPrototype()
Returns the prototype. |
Element |
getPrototypeFromParent(Element parent)
Return the proper prototype for this element stored in the parent. |
AbstractTemplate |
getTemplate()
Returns the template of this element. |
int |
getX()
Returns the value of the x property. |
int |
getY()
Returns the value of the y property. |
boolean |
hasFlag(String property)
Returns the value of a boolean property. |
void |
importInto(Element parent)
Imports the tree rooted at this element into the prototype structure of the given parent. |
boolean |
isPropertyLocal(String name)
Returns true if the property of the given name has a local value. |
void |
removeListener(EventListener l)
Removes an event listener. |
void |
setProperties(Object[] properties)
|
Property |
setProperty(String name,
Object value)
Sets and returns the given property. |
void |
setPropertyFromPath(String path,
Object value)
|
void |
setPrototype(Element prototype)
Sets the prototype of this element to the given argument. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public List<EventListener> listeners
public Element prototype
protected Map<String,Property> properties
| Constructor Detail |
|---|
public Element(Element prototype)
| Method Detail |
|---|
public boolean isPropertyLocal(String name)
public Property getProperty(String name)
public Property getLocalProperty(String name)
public Object getPropertyValue(String name)
public boolean hasFlag(String property)
public int getX()
Integer.
public int getY()
Integer.
public Color getColor()
Color.
public Property setProperty(String name,
Object value)
public void setPropertyFromPath(String path,
Object value)
public void setProperties(Object[] properties)
public Set<Map.Entry<String,Property>> getProperties()
public Element getParent()
public void addListener(EventListener l)
public void removeListener(EventListener l)
public void accept(Visitor visitor)
throws Exception
Exceptionpublic void acceptSafe(Visitor visitor)
public Element getPrototype()
public Document getDocument()
public AbstractTemplate getTemplate()
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic Element getPrototypeFromParent(Element parent)
public void importInto(Element parent)
public void setPrototype(Element prototype)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||