|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.util.WrappedObjectDataProvider
This class can be used to wrap a given DataProvider with another one. It is intended to work with DataProviders providing Objects only. Whenever data is not found in the decorating DataProvider (known as the wrapper). The underlying dataprovider will be queried.
Constructor Summary | |
WrappedObjectDataProvider(DataProvider wrapper,
DataProvider provider)
Creates a new instance of WrappedDataProvider. |
|
WrappedObjectDataProvider(DataProvider wrapper,
Graph graph,
Object dataProviderKey)
Creates a new instance of WrappedDataProvider. |
Method Summary | |
void |
dispose()
Disposes previously allocated datastructures. |
Object |
get(Object dataHolder)
Returns an object value associated with the given data holder. |
boolean |
getBool(Object dataHolder)
Returns a boolean value associated with the given data holder. |
double |
getDouble(Object dataHolder)
Returns a double value associated with the given data holder. |
int |
getInt(Object dataHolder)
Returns an integer value associated with the given data holder. |
DataProvider |
getWrappedProvider()
Gets the underlying wrapped DataProvider. |
DataProvider |
getWrappingProvider()
Gets the wrapping DataProvider instance. |
void |
unwrap()
Undoes a previous wrap() operation. |
void |
wrap(Graph g,
Object dataProviderKey)
Performs the wrapping, the given DataProvider will be unregistered from the graph and replaced with this instance. |
static WrappedObjectDataProvider |
wrapUsingEdgeMap(Graph graph,
Object dataProviderKey)
Creates a new instance of WrappedDataProvider. |
static WrappedObjectDataProvider |
wrapUsingNodeMap(Graph graph,
Object dataProviderKey)
Creates a new instance of WrappedDataProvider. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WrappedObjectDataProvider(DataProvider wrapper, DataProvider provider)
wrapper
- The DataProvider instance which will be queried firstprovider
- the dataprovider which will be wrapped by the first onepublic WrappedObjectDataProvider(DataProvider wrapper, Graph graph, Object dataProviderKey)
this
. This can be undone
by calling unwrap()
wrapper
- the wrapping dataprovidergraph
- the graph which will be registered with the dataprovidersdataProviderKey
- the key used for registeringMethod Detail |
public static WrappedObjectDataProvider wrapUsingEdgeMap(Graph graph, Object dataProviderKey)
unwrap()
graph
- the graph which will be registered with the dataprovidersdataProviderKey
- the key used for registering and wrappingpublic static WrappedObjectDataProvider wrapUsingNodeMap(Graph graph, Object dataProviderKey)
unwrap()
graph
- the graph which will be registered with the dataprovidersdataProviderKey
- the key used for registering and wrappingpublic void wrap(Graph g, Object dataProviderKey)
g
- the graph which will be registered with the dataprovidersdataProviderKey
- the key used for registeringpublic void unwrap()
public Object get(Object dataHolder)
DataProvider
get
in interface DataProvider
public boolean getBool(Object dataHolder)
DataProvider
getBool
in interface DataProvider
public double getDouble(Object dataHolder)
DataProvider
getDouble
in interface DataProvider
public int getInt(Object dataHolder)
DataProvider
getInt
in interface DataProvider
public DataProvider getWrappedProvider()
public DataProvider getWrappingProvider()
this
.
public void dispose()
unwrap()
is made. Then the wrappers are disposed from the
graph if they are instances of NodeMaps or EdgeMaps respectively.
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |