Packagecom.yworks.yfiles.util
Classpublic class WrappedObjectDataProvider
InheritanceWrappedObjectDataProvider Inheritance YObject Inheritance Object
Implements DataProvider

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 data provider will be queried.



Public Properties
 PropertyDefined By
  dataMapView : DataMap
[read-only] Returns a DataMap that can be used to read and write values.
WrappedObjectDataProvider
  wrappedProvider : DataProvider
[read-only] Gets the underlying wrapped DataProvider.
WrappedObjectDataProvider
  wrappingProvider : DataProvider
[read-only] Gets the wrapping DataProvider instance.
WrappedObjectDataProvider
Public Methods
 MethodDefined By
  
WrappedObjectDataProvider(wrapper:DataProvider, provider:DataProvider, init:Boolean = true)
Creates a new instance of WrappedDataProvider.
WrappedObjectDataProvider
  
dispose():void
Disposes previously allocated data structures.
WrappedObjectDataProvider
 Inherited
equals(o:Object):Boolean
YObject
  
getBool(dataHolder:Object):Boolean
WrappedObjectDataProvider
  
getClass():Class
[override]
WrappedObjectDataProvider
  
getDouble(dataHolder:Object):Number
WrappedObjectDataProvider
  
getInt(dataHolder:Object):int
WrappedObjectDataProvider
  
getObject(dataHolder:Object):Object
WrappedObjectDataProvider
 Inherited
hashCode():int
YObject
  
[static] Creates a new instance of WrappedDataProvider.
WrappedObjectDataProvider
  
[static] Creates a new instance of WrappedDataProvider.
WrappedObjectDataProvider
  
unwrap():void
Undoes a previous wrap() operation.
WrappedObjectDataProvider
  
wrap(g:Graph, dataProviderKey:Object):void
Performs the wrapping, the given DataProvider will be unregistered from the graph and replaced with this instance.
WrappedObjectDataProvider
  
wrapUsingEdgeMap(graph:Graph, dataProviderKey:Object):WrappedObjectDataProvider
[static] Creates a new instance of WrappedDataProvider.
WrappedObjectDataProvider
  
wrapUsingNodeMap(graph:Graph, dataProviderKey:Object):WrappedObjectDataProvider
[static] Creates a new instance of WrappedDataProvider.
WrappedObjectDataProvider
Protected Methods
 MethodDefined By
  
Initializes this object.
WrappedObjectDataProvider
  
initWrappedObjectDataProvider2(wrapper:DataProvider, graph:Graph, dataProviderKey:Object):void
Initializes this object.
WrappedObjectDataProvider
Property Detail
dataMapViewproperty
dataMapView:DataMap  [read-only]

Returns a DataMap that can be used to read and write values.


Implementation
    public function get dataMapView():DataMap
wrappedProviderproperty 
wrappedProvider:DataProvider  [read-only]

Gets the underlying wrapped DataProvider.


Implementation
    public function get wrappedProvider():DataProvider
wrappingProviderproperty 
wrappingProvider:DataProvider  [read-only]

Gets the wrapping DataProvider instance. This can safely be cast to a NodeMap or an EdgeMap respectively if the appropriate static factory methods have been used for the construction of this.


Implementation
    public function get wrappingProvider():DataProvider
Constructor Detail
WrappedObjectDataProvider()Constructor
public function WrappedObjectDataProvider(wrapper:DataProvider, provider:DataProvider, init:Boolean = true)

Creates a new instance of WrappedDataProvider. This instance will delegate queries to the wrapper first. Unsatisfied requests will be delegated to the original second provider.

Parameters
wrapper:DataProvider — The DataProvider instance which will be queried first
 
provider:DataProvider — the data provider which will be wrapped by the first one
 
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
dispose()method
public function dispose():void

Disposes previously allocated data structures. First a call to unwrap() is made. Then the wrappers are disposed from the graph if they are instances of NodeMaps or EdgeMaps respectively.

getBool()method 
public function getBool(dataHolder:Object):Boolean

Parameters

dataHolder:Object

Returns
Boolean
getClass()method 
override public function getClass():Class

Returns
Class
getDouble()method 
public function getDouble(dataHolder:Object):Number

Parameters

dataHolder:Object

Returns
Number
getInt()method 
public function getInt(dataHolder:Object):int

Parameters

dataHolder:Object

Returns
int
getObject()method 
public function getObject(dataHolder:Object):Object

Parameters

dataHolder:Object

Returns
Object
initWrappedObjectDataProvider1()method 
protected final function initWrappedObjectDataProvider1(wrapper:DataProvider, provider:DataProvider):void

Initializes this object. See the documentation of the corresponding factory method newWrappedObjectDataProvider1() for details.

Parameters

wrapper:DataProvider
 
provider:DataProvider

See also

initWrappedObjectDataProvider2()method 
protected final function initWrappedObjectDataProvider2(wrapper:DataProvider, graph:Graph, dataProviderKey:Object):void

Initializes this object. See the documentation of the corresponding factory method newWrappedObjectDataProvider2() for details.

Parameters

wrapper:DataProvider
 
graph:Graph
 
dataProviderKey:Object

See also

newWrappedObjectDataProvider1()method 
public static function newWrappedObjectDataProvider1(wrapper:DataProvider, provider:DataProvider):WrappedObjectDataProvider

Creates a new instance of WrappedDataProvider. This instance will delegate queries to the wrapper first. Unsatisfied requests will be delegated to the original second provider.

Parameters

wrapper:DataProvider — The DataProvider instance which will be queried first
 
provider:DataProvider — the data provider which will be wrapped by the first one

Returns
WrappedObjectDataProvider
newWrappedObjectDataProvider2()method 
public static function newWrappedObjectDataProvider2(wrapper:DataProvider, graph:Graph, dataProviderKey:Object):WrappedObjectDataProvider

Creates a new instance of WrappedDataProvider. This instance will delegate queries to the wrapper first. Unsatisfied requests will be delegated to the original provider. This method wraps the currently registered DataProvider with this. This can be undone by calling unwrap()

Parameters

wrapper:DataProvider — the wrapping data provider
 
graph:Graph — the graph which will be registered with the data providers
 
dataProviderKey:Object — the key used for registering

Returns
WrappedObjectDataProvider
unwrap()method 
public function unwrap():void

Undoes a previous wrap() operation.

wrap()method 
public function wrap(g:Graph, dataProviderKey:Object):void

Performs the wrapping, the given DataProvider will be unregistered from the graph and replaced with this instance.

Parameters

g:Graph — the graph which will be registered with the data providers
 
dataProviderKey:Object — the key used for registering

wrapUsingEdgeMap()method 
public static function wrapUsingEdgeMap(graph:Graph, dataProviderKey:Object):WrappedObjectDataProvider

Creates a new instance of WrappedDataProvider. This instance will delegate queries to a newly created EdgeMap wrapper first. Unsatisfied requests will be delegated to the original provider. This method wraps the currently registered DataProvider with the returned DataProvider instance. This can be undone by calling unwrap()

Parameters

graph:Graph — the graph which will be registered with the data providers
 
dataProviderKey:Object — the key used for registering and wrapping

Returns
WrappedObjectDataProvider
wrapUsingNodeMap()method 
public static function wrapUsingNodeMap(graph:Graph, dataProviderKey:Object):WrappedObjectDataProvider

Creates a new instance of WrappedDataProvider. This instance will delegate queries to a newly created NodeMap wrapper first. Unsatisfied requests will be delegated to the original provider. This method wraps the currently registered DataProvider with the returned DataProvider instance. This can be undone by calling unwrap()

Parameters

graph:Graph — the graph which will be registered with the data providers
 
dataProviderKey:Object — the key used for registering and wrapping

Returns
WrappedObjectDataProvider