Search this API

y.util
Class DataProviderAdapter

java.lang.Object
  extended by y.util.DataProviderAdapter
All Implemented Interfaces:
DataProvider
Direct Known Subclasses:
AlignmentDrawer.BottomAlignmentDataProvider, AlignmentDrawer.LeftAlignmentDataProvider, AlignmentDrawer.RightAlignmentDataProvider, AlignmentDrawer.TopAlignmentDataProvider, GroupLayoutConfigurator.MinNodeSizeDataProvider, LeftRightPlacer.LeftRightDataProvider, NodeRealizerIntersectionCalculator

public abstract class DataProviderAdapter
extends java.lang.Object
implements DataProvider

An abstract adapter class for providing data. The data provision methods in this class throw a UnsupportedOperationException and defined(Object) always returns false.

This class exists as a convenience for creating data provider objects.

Extend this class to provide either typed or untyped data for a certain lookup domain.

 

Constructor Summary
DataProviderAdapter()
           
 
Method Summary
 boolean defined(java.lang.Object dataHolder)
          Returns false for all data holders.
 java.lang.Object get(java.lang.Object dataHolder)
          Subclasses may override this method to provide access to object values.
 boolean getBool(java.lang.Object dataHolder)
          Subclasses may override this method to provide access to boolean values.
 double getDouble(java.lang.Object dataHolder)
          Subclasses may override this method to provide access to double values.
 int getInt(java.lang.Object dataHolder)
          Subclasses may override this method to provide access to integer values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataProviderAdapter

public DataProviderAdapter()
Method Detail

get

public java.lang.Object get(java.lang.Object dataHolder)
Subclasses may override this method to provide access to object values.

Specified by:
get in interface DataProvider
Throws:
java.lang.UnsupportedOperationException - unless overwritten.

getInt

public int getInt(java.lang.Object dataHolder)
Subclasses may override this method to provide access to integer values.

Specified by:
getInt in interface DataProvider
Throws:
java.lang.UnsupportedOperationException - unless overwritten.

getDouble

public double getDouble(java.lang.Object dataHolder)
Subclasses may override this method to provide access to double values.

Specified by:
getDouble in interface DataProvider
Throws:
java.lang.UnsupportedOperationException - unless overwritten.

getBool

public boolean getBool(java.lang.Object dataHolder)
Subclasses may override this method to provide access to boolean values.

Specified by:
getBool in interface DataProvider
Throws:
java.lang.UnsupportedOperationException - unless overwritten.

defined

public boolean defined(java.lang.Object dataHolder)
Returns false for all data holders. Subclasses should override this method to make clear for which data holders there is a value accessible via this data provider.

Returns:
false.

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