TItem - The type of the items that are mapped.TValue - The type of the values the items are mapped to.public class ItemMapping<TItem,TValue> extends Object
LayoutData.
Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties
Mapper, Delegate and Constant should be set on
each instance.
This class supports LayoutData implementations and does not usually have to be used explicitly.
| Constructor and Description |
|---|
ItemMapping() |
| Modifier and Type | Method and Description |
|---|---|
TValue |
getConstant()
Gets a constant value all items are mapped to.
|
Function<TItem,TValue> |
getDelegate()
Gets a delegate that implements the mapping.
|
IMapper<TItem,TValue> |
getMapper()
Gets an
IMapper that realizes the mapping. |
IMapper<TItem,TValue> |
provideMapper(LayoutGraphAdapter adapter,
ILayoutAlgorithm layout)
Provides a mapper mapping the items to values.
|
void |
setConstant(TValue value)
Sets a constant value all items are mapped to.
|
void |
setDelegate(Function<TItem,TValue> value)
Sets a delegate that implements the mapping.
|
void |
setMapper(IMapper<TItem,TValue> value)
Sets an
IMapper that realizes the mapping. |
public final TValue getConstant()
setConstant(java.lang.Object)public final Function<TItem,TValue> getDelegate()
setDelegate(Function)public final IMapper<TItem,TValue> getMapper()
IMapper that realizes the mapping.setMapper(IMapper)public IMapper<TItem,TValue> provideMapper(LayoutGraphAdapter adapter, ILayoutAlgorithm layout)
adapter - The graph adapter the mapper shall be provided for.layout - The layout using the mapper.public final void setConstant(TValue value)
value - The Constant to set.getConstant()public final void setDelegate(Function<TItem,TValue> value)
value - The Delegate to set.getDelegate()public final void setMapper(IMapper<TItem,TValue> value)
IMapper that realizes the mapping.value - The Mapper to set.getMapper()