de.cau.cs.kieler.core.properties
Interface IPropertyHolder

All Known Subinterfaces:
EMapPropertyHolder, KEdgeLayout, KGraphData, KIdentifier, KShapeLayout
All Known Implementing Classes:
EMapPropertyHolderImpl, FBendpoint, FEdge, FGraph, FLabel, FNode, FParticle, KEdgeLayoutImpl, KGraphDataImpl, KIdentifierImpl, KShapeLayoutImpl, Layer, LayeredGraph, LayoutContext, LayoutMapping, LEdge, LGraphElement, LLabel, LNode, LPort, LShape, MapPropertyHolder, PartTrigger.EditorState, PartTrigger.PartState, TransformationData

public interface IPropertyHolder

Interface for holders of property values.

Rating yellow
(2011-01-17) reviewed by haf, cmot, soh

Method Summary
 void copyProperties(IPropertyHolder holder)
          Copy all properties from another property holder to this one.
 Map<IProperty<?>,Object> getAllProperties()
          Returns a map of all assigned properties with associated values.
<T> T
getProperty(IProperty<T> property)
          Retrieves a property value.
 void setProperty(IProperty<?> property, Object value)
          Sets a property value.
 

Method Detail

setProperty

void setProperty(IProperty<?> property,
                 Object value)
Sets a property value. No type checking is performed while setting, so users of this method must take care that the right object types are generated.

Parameters:
property - the property to set
value - the new value

getProperty

<T> T getProperty(IProperty<T> property)
Retrieves a property value. If the property is not set, its default value shall be taken, which is taken from the given property instance.

Type Parameters:
T - type of property
Parameters:
property - the property to get
Returns:
the current value, or the default value if the property is not set

copyProperties

void copyProperties(IPropertyHolder holder)
Copy all properties from another property holder to this one.

Parameters:
holder - another property holder

getAllProperties

Map<IProperty<?>,Object> getAllProperties()
Returns a map of all assigned properties with associated values.

Returns:
a map of all properties