info.informatica.data
Class AbstractDataset

java.lang.Object
  extended by info.informatica.data.AbstractDataset
All Implemented Interfaces:
Dataset
Direct Known Subclasses:
GenericDataset, ResultsetDataset

public abstract class AbstractDataset
extends Object
implements Dataset

Utility abstract base class for several (sometimes metadata-unaware) Dataset implementations.

Version:
1.03
Author:
amengual at informatica dot info

Method Summary
 void close()
          Closes the Dataset.
 Object evaluate(String id)
          Sometimes you want to directly access a field or method and evaluate it, instead of getting the object and then accessing the field or calling the method.
 int findColumn(FieldName name)
          Finds the index of the given column name of the dataset.
 String getCatalogName(int i)
          Gets the designated data item's catalog name
 int getColumnCount()
           
 FieldName getColumnName(int i)
          Gets the designated data item's column name
 Map<String,? extends Object> getEnviron()
          Gets a global "environment" Map, if available.
 String getLabel()
          Gets the label of this Set, or null if not available.
 MetaData getMetaData()
          Gets the meta data for this data set.
 Dataset getNestedSet(String datasetName)
          It is allowed to have another Datasets nested to the current Dataset row.
 boolean next()
          Positions the Dataset at the next row of data.
 void setEnviron(Map<String,? extends Object> environ)
          Sets a global "environment" Map.
 void setLabel(String label)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.informatica.data.Dataset
getDate, getDate, getDouble, getDouble, getInt, getInt, getLong, getLong, getMap, getObject, getObject, getString, getString, isAfterLast, isEmpty, isLast, reset
 

Method Detail

getColumnCount

public int getColumnCount()
                   throws DatasetException
Specified by:
getColumnCount in interface Dataset
Returns:
the number of columns of this Dataset.
Throws:
DatasetException - if the data repository produced an error.

setLabel

public void setLabel(String label)

getLabel

public String getLabel()
Description copied from interface: Dataset
Gets the label of this Set, or null if not available.

Specified by:
getLabel in interface Dataset

getCatalogName

public String getCatalogName(int i)
                      throws DatasetException
Gets the designated data item's catalog name

Specified by:
getCatalogName in interface Dataset
Throws:
DatasetException - if the data repository produced an error.

getColumnName

public FieldName getColumnName(int i)
                        throws DatasetException
Gets the designated data item's column name

Specified by:
getColumnName in interface Dataset
Throws:
DatasetException

next

public boolean next()
             throws DatasetException
Description copied from interface: Dataset
Positions the Dataset at the next row of data.

Specified by:
next in interface Dataset
Returns:
false if there were no more rows, true otherwise.
Throws:
DatasetException - if the data repository produced an error.

evaluate

public Object evaluate(String id)
                throws DatasetException
Description copied from interface: Dataset
Sometimes you want to directly access a field or method and evaluate it, instead of getting the object and then accessing the field or calling the method. The evaluate method provides a way to do that, and when called it will either return a variable named id or a method evaluation of the style package.object.method.

Specified by:
evaluate in interface Dataset
Parameters:
id - Fully qualified function name (package.object.function) or fqfn
Returns:
the result given by the function, or the object itself if there is no function (dot not specified in fqfn), or null if the function or method are not available.
Throws:
DatasetException - if the data repository produced an error.

close

public void close()
           throws DatasetException
Description copied from interface: Dataset
Closes the Dataset.

No further work is possible with the Dataset after closing it.

Specified by:
close in interface Dataset
Throws:
DatasetException - if an error happens when closing the Dataset.

findColumn

public int findColumn(FieldName name)
               throws DatasetException
Description copied from interface: Dataset
Finds the index of the given column name of the dataset.

Specified by:
findColumn in interface Dataset
Returns:
the index of the given column name of the dataset, or -1 if the column name is not known.
Throws:
DatasetException - if an error happens when accessing the data.

getMetaData

public MetaData getMetaData()
                     throws DataException
Description copied from interface: Dataset
Gets the meta data for this data set.

Specified by:
getMetaData in interface Dataset
Returns:
the meta data for this data set, or null if not available.
Throws:
DataException - if the data repository produced an error.

setEnviron

public void setEnviron(Map<String,? extends Object> environ)
Description copied from interface: Dataset
Sets a global "environment" Map.

Specified by:
setEnviron in interface Dataset
Parameters:
environ - a Map with the environment.

getEnviron

public Map<String,? extends Object> getEnviron()
Description copied from interface: Dataset
Gets a global "environment" Map, if available.

Specified by:
getEnviron in interface Dataset
Returns:
a Map with the environment, or null if no environment is available.

getNestedSet

public Dataset getNestedSet(String datasetName)
                     throws DatasetException
Description copied from interface: Dataset
It is allowed to have another Datasets nested to the current Dataset row.

This is an optional operation. Datasets not supporting it must throw an UnsupportedOperationException.

Specified by:
getNestedSet in interface Dataset
Parameters:
datasetName - the name of the requested Dataset.
Returns:
the Dataset nested into the current row.
Throws:
DatasetException - if the data repository produced an error.