TItem - The type of the items that are mapped.TValue - The type of the values the items are mapped to.TContext - The type of the context passed to the ContextDelegatepublic class ContextItemMapping<TItem,TValue,TContext> extends ItemMapping<TItem,TValue>
Only one of the provided ways to define a mapping can be used at the same time, therefore only one of the properties
ContextDelegate, Delegate,
Mapper, 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 |
|---|
ContextItemMapping() |
| Modifier and Type | Method and Description |
|---|---|
BiFunction<TItem,TContext,TValue> |
getContextDelegate()
Gets a delegate from the items and a context object to the values.
|
IMapper<TItem,TValue> |
provideMapper(LayoutGraphAdapter adapter,
ILayoutAlgorithm layout,
TContext context)
Provides a mapper mapping the items to values.
|
void |
setContextDelegate(BiFunction<TItem,TContext,TValue> value)
Sets a delegate from the items and a context object to the values.
|
getConstant, getDelegate, getMapper, provideMapper, setConstant, setDelegate, setMapperpublic final BiFunction<TItem,TContext,TValue> getContextDelegate()
setContextDelegate(BiFunction)public IMapper<TItem,TValue> provideMapper(LayoutGraphAdapter adapter, ILayoutAlgorithm layout, TContext context)
adapter - The graph adapter the mapper shall be provided for.layout - The layout using the mapper.context - The context object passed to the ContextDelegate.public final void setContextDelegate(BiFunction<TItem,TContext,TValue> value)
value - The ContextDelegate to set.getContextDelegate()