An implementation of a chain of IContextLookupChainLinks.
Type Details
- yfiles module
- view-component
- yfiles-umd modules
- All view modules
- Legacy UMD name
- yfiles.graph.LookupChain
Methods
Adds the given link to the end of the chain.
Parameters
A map of options to pass to the method.
- lookup - IContextLookupChainLink
- The link to add.
See Also
add
<TContext,TResult>(contextType: Class, resultType: Class, factory: function(TContext):TResult, nullIsFallback?: boolean) : IContextLookupChainLinkA convenience method that adds a IContextLookupChainLink to the given chain that is based on a function of type function(
TContext
)
.
Remarks
nullIsFallback
, null
return values of the factory
will be interpreted as the final result or indicate to the implementation that the chain should be queried for the result.Type Parameters
- TContext
- The type of the context.
- TResult
- The type of the result.
Parameters
A map of options to pass to the method.
- contextType - Class
- The type of the context.
- resultType - Class
- The type of the result.
- factory - function(TContext):TResult
- The factory that will be called for queries to
TResult
.Signature Details
function(item: TContext) : TResult
A function which provides a custom into a custom implementation ofTInterface
for the givenitem
.Parameters
- item - TContext
- The item to return the implementation for.
Returns
- TResult
- The new implementation.
- nullIsFallback - boolean
- If set to
true
,null
return values of the factory method will be interpreted as the final result, otherwise the request will propagate down the chain.
Returns
- ↪IContextLookupChainLink
- The link that has been registered with the chain.
add
<TContext,TResult>(contextType: Class, resultType: Class, wrapperFactory: function(TContext, TResult):TResult, decorateNull?: boolean) : IContextLookupChainLinkA convenience method that adds a IContextLookupChainLink to the given chain that is based on a function of type function(TContext, TResult)
.
Remarks
decorateNull
, null
results of the underlying chain will be passed to the wrapperFactory
, or simply yielded as the final result.Type Parameters
- TContext
- The type of the context.
- TResult
- The type of the result.
Parameters
A map of options to pass to the method.
- contextType - Class
- The type of the context.
- resultType - Class
- The type of the result.
- wrapperFactory - function(TContext, TResult):TResult
- The wrapper factory that will be called for queries to
TResult
to wrap the result of the query to the remainder of the chain.Signature Details
function(item: TContext, originalImplementation: TResult) : TResult
A function which wraps theoriginalImplementation
ofTInterface
into a custom implementation for the givenitem
.Parameters
- item - TContext
- The item to return the wrapped implementation for.
- originalImplementation - TResult
- The original implementation to wrap.
Returns
- TResult
- The new implementation.
- decorateNull - boolean
- if set to
true
null
return values of the remainder of the chain will be passed to the wrapper factory so that it can decorate the null, otherwise null will be yielded as the final result.
Returns
- ↪IContextLookupChainLink
- The link that has been registered with the chain.
Adds a lookup implementation that always yields a constant result
to the chain.
Type Parameters
- TResult
- The type of the query, which is a base type or the type of the result.
Parameters
A map of options to pass to the method.
- resultType - Class
- result - TResult
- The constant value to yield if the chain is queried for an implementation of type
TResult
.
Returns
- ↪IContextLookupChainLink
- The IContextLookupChainLink instance that has been added to the chain.
Performs the actual lookup operation.
Remarks
Parameters
A map of options to pass to the method.
Returns
- ↪Object
- The result of the query.
See Also
Implements
Can be called by client code to trigger the PropertyChanged event manually.
Notifies client code that the lookup of this instance might have changed.
Parameters
A map of options to pass to the method.
- evt - PropertyChangedEventArgs
- The arguments
Removes the link that has previously been added to this instance from this chain.
Parameters
A map of options to pass to the method.
- link - IContextLookupChainLink
- The link to remove.
Events
Occurs when the lookup of this instance has changed for some or all of the types or items.
Overrides
Event Registration
addPropertyChangedListener(function(this, PropertyChangedEventArgs):void)
Event Deregistration
removePropertyChangedListener(function(this, PropertyChangedEventArgs):void)
Signature Details
function(sender: any, args: PropertyChangedEventArgs)
Parameters
- sender - any
- The object which dispatched the event.
- args - PropertyChangedEventArgs
- The arguments which define the change.