|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fhstralsund.vinets.structure.DefaultNetElement
public abstract class DefaultNetElement
The standard implementation for NetElements in VinetS.
Field Summary | |
---|---|
protected NetElement |
host
The NetElement containing this NetElement (its parent in hierarchy). |
protected java.util.Map |
labelMap
A container of (key, label)-pairs for all properties of this NetElement. |
protected NetElement |
original
A NetElement from which this one was copied. |
Constructor Summary | |
---|---|
protected |
DefaultNetElement()
|
protected |
DefaultNetElement(NetElement host)
|
protected |
DefaultNetElement(java.lang.String name,
NetElement host)
|
protected |
DefaultNetElement(java.lang.String name,
NetElement host,
java.lang.Object data)
|
Method Summary | |
---|---|
void |
clearLabels()
Clears all labels of this NetElement. |
java.lang.Object |
clone()
Creates and returns a special copy of this NetElement. |
boolean |
containsLabel(java.lang.Object key)
Returns true if the label contains a mapping for the specified key. |
boolean |
getBooleanLabel(java.lang.Object key)
Returns the label value associated with the passed key as boolean value. |
java.lang.Object |
getData()
Delivers application specific data stored by this NetElement which have no relation to the network algorithms. |
double |
getDoubleLabel(java.lang.Object key)
Returns the label value associated with the passed key as double value. |
NetElementGeometry |
getGeometry()
Delivers the NetElementGeometry instance containing the position and the size of this NetElement in the relative coordinate system of its host. |
NetElement |
getHost()
Delivers the parent of this NetElement in the inclusion hierarchy. |
java.lang.Object |
getID()
Delivers the identifier of this NetElement. |
int |
getIntLabel(java.lang.Object key)
Returns the label value associated with the passed key as int value. |
java.lang.Object |
getLabel(java.lang.Object key)
Returns the label value associated with the passed key, or null if the labelMap does not contain a mapping for this key. |
java.util.Set |
getLabelKeySet()
Returns a Set which contains the Keys inside the LabelMap. |
java.lang.String |
getName()
Delivers a human readable name of this NetElement. |
NetElement |
getOriginal()
Delivers the NetElement from which this one was copied. |
de.fhstralsund.vinets.graphics.NetElementRepresentation |
getRepresentation()
Delivers the NetElementRepresentation instance containing information for rendering this NetElement. |
java.lang.Object |
removeLabel(java.lang.Object key)
Removes a property stored as label from this NetElement. |
void |
setBooleanLabel(java.lang.Object key,
boolean b)
Adds to this NetElement a boolean value label or changes it. |
void |
setData(java.lang.Object info)
Assigns new application specific data to this NetElement which have no relation to the network algorithms. |
void |
setDoubleLabel(java.lang.Object key,
double x)
Adds to this NetElement a double value label or changes it. |
void |
setGeometry(NetElementGeometry geom)
Assigns a new NetElementGeometry instance containing the position and the size of this NetElement in the relative coordinate system of its host. |
void |
setIntLabel(java.lang.Object key,
int i)
Adds to this NetElement an integer value label or changes it. |
void |
setLabel(java.lang.Object key,
java.lang.Object value)
Adds a new property to be stored as a label of this NetElement or changes the value of an existing property. |
void |
setName(java.lang.String name)
Sets a human readable name for this NetElement. |
void |
setRepresentation(de.fhstralsund.vinets.graphics.NetElementRepresentation pres)
Assigns a new NetElementRepresentation instance containing information for rendering this NetElement. |
java.lang.String |
toString()
Returns a string representation of this NetElement. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected NetElement host
protected NetElement original
protected java.util.Map labelMap
Constructor Detail |
---|
protected DefaultNetElement(java.lang.String name, NetElement host, java.lang.Object data)
protected DefaultNetElement()
protected DefaultNetElement(NetElement host)
protected DefaultNetElement(java.lang.String name, NetElement host)
Method Detail |
---|
public java.lang.Object getID()
getID
in interface NetElement
public java.lang.String getName()
getName
in interface NetElement
public void setName(java.lang.String name)
setName
in interface NetElement
name
- the name.public NetElementGeometry getGeometry()
getGeometry
in interface NetElement
public void setGeometry(NetElementGeometry geom)
setGeometry
in interface NetElement
geom
- a reference to the new NetElementGeometry.public de.fhstralsund.vinets.graphics.NetElementRepresentation getRepresentation()
getRepresentation
in interface NetElement
public void setRepresentation(de.fhstralsund.vinets.graphics.NetElementRepresentation pres)
setRepresentation
in interface NetElement
pres
- a reference to the graphic representation of this
NetElement.public java.lang.Object getData()
getData
in interface NetElement
public void setData(java.lang.Object info)
setData
in interface NetElement
info
- a reference to the external information to be stored.public NetElement getHost()
getHost
in interface NetElement
public NetElement getOriginal()
getOriginal
in interface NetElement
public void setLabel(java.lang.Object key, java.lang.Object value)
setLabel
in interface NetElement
key
- an Object with which the specified value is to be
associated.value
- an Object to be associated with the specified key.
java.lang.IllegalArgumentException
- if the key is null.public java.lang.Object getLabel(java.lang.Object key)
getLabel
in interface NetElement
key
- the key whose associated value is to be returned.
setLabel(Object, Object)
public java.util.Set getLabelKeySet()
NetElement
getLabelKeySet
in interface NetElement
public boolean containsLabel(java.lang.Object key)
containsLabel
in interface NetElement
key
- the key whose presence as label is to be tested.
setLabel(Object, Object)
public java.lang.Object removeLabel(java.lang.Object key)
removeLabel
in interface NetElement
key
- the key of the property to remove.
setLabel(Object, Object)
public void clearLabels()
clearLabels
in interface NetElement
public void setIntLabel(java.lang.Object key, int i)
setIntLabel
in interface NetElement
key
- an Object with which the integer value is to be
associated.i
- an int value to be associated with the
specified key.setLabel(Object, Object)
public int getIntLabel(java.lang.Object key)
getIntLabel
in interface NetElement
key
- the key whose associated integer value is to be returned.
getLabel(Object)
public void setDoubleLabel(java.lang.Object key, double x)
setDoubleLabel
in interface NetElement
key
- an Object with which the double value is to be
associated.x
- a double value to be associated with the
specified key.setLabel(Object, Object)
public double getDoubleLabel(java.lang.Object key)
getDoubleLabel
in interface NetElement
key
- the key whose associated double value is to be returned.
getLabel(Object)
public void setBooleanLabel(java.lang.Object key, boolean b)
setBooleanLabel
in interface NetElement
key
- an Object with which the boolean value is to be
associated.b
- true or false to be associated with
the specified key.setLabel(Object, Object)
public boolean getBooleanLabel(java.lang.Object key)
getBooleanLabel
in interface NetElement
key
- the key whose associated boolean value is to be returned.
getLabel(Object)
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |