Search this API

y.io.graphml
Interface Lookup

All Known Subinterfaces:
GraphMLParseContext, GraphMLWriteContext
All Known Implementing Classes:
ChildParseContext, ChildWriteContext, DictionaryLookup

public interface Lookup

The basic lookup interface that allows for retrieving implementations for different aspects of the current instance.

The lookup idiom allows for dynamically providing, adding, changing, and removing implementation aspects of an instance that would not be possible to achieve.

See Also:
DictionaryLookup
 

Method Summary
 java.lang.Object lookup(java.lang.Class type)
          Returns an instance that implements the given type or null.
 

Method Detail

lookup

java.lang.Object lookup(java.lang.Class type)
Returns an instance that implements the given type or null.

Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is quite similar to casting or compile time constraints. An instance implementing this method is not required to return non-null implementations for the types, nor does it have to return the same instance any time. Additionally, it depends on the type and context whether the instance returned stays up to date or needs to be retrieved again for subsequent use.

Parameters:
type - the type for which an instance shall be returned
Returns:
an instance that is assignable to type or null

© Copyright 2000-2022,
yWorks GmbH.
All rights reserved.