info.informatica.data
Class GenericDataset

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

public abstract class GenericDataset
extends AbstractDataset

An abstract Generic Dataset to be used by subclasses.

Version:
1.03
Author:
amengual at informatica dot info

Constructor Summary
GenericDataset(Collection<String> column_names)
           
GenericDataset(List<String> column_names)
           
 
Method Summary
 void close()
          Closes the Dataset.
 Date getDate(FieldName id)
          Returns Date of name id.
 Date getDate(int i)
          Returns Date of index i.
 double getDouble(FieldName id)
          Returns double of name id
 double getDouble(int i)
          Returns int of index i
 int getInt(FieldName id)
          Returns int of name id
 int getInt(int i)
          Returns int of index i
 long getLong(FieldName id)
          Returns long of name id
 long getLong(int i)
          Returns long of index i
 Map<FieldName,Object> getMap()
          Gets a name-> values map containing the current data row.
 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.
 Object getObject(FieldName id)
          Returns Object of name id
 Object getObject(int i)
          Returns Object of index i
 String getString(FieldName id)
          Returns String of name id.
 String getString(int i)
          Returns String of index i.
 void setMetaData(MetaData md)
           
 
Methods inherited from class info.informatica.data.AbstractDataset
evaluate, findColumn, getCatalogName, getColumnCount, getColumnName, getEnviron, getLabel, next, setEnviron, setLabel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface info.informatica.data.Dataset
isAfterLast, isEmpty, isLast, reset
 

Constructor Detail

GenericDataset

public GenericDataset(List<String> column_names)

GenericDataset

public GenericDataset(Collection<String> column_names)
Method Detail

getDate

public Date getDate(int i)
             throws DatasetException
Description copied from interface: Dataset
Returns Date of index i.

Returns:
the Date value of index i.
Throws:
DatasetException - if the data repository produced an error.

getDate

public Date getDate(FieldName id)
             throws DatasetException
Description copied from interface: Dataset
Returns Date of name id.

Returns:
the Date value of name id.
Throws:
DatasetException - if the data repository produced an error.

getDouble

public double getDouble(int i)
                 throws DatasetException
Description copied from interface: Dataset
Returns int of index i

Throws:
DatasetException - if the data repository produced an error.

getDouble

public double getDouble(FieldName id)
                 throws DatasetException
Description copied from interface: Dataset
Returns double of name id

Throws:
DatasetException - if the data repository produced an error.

getInt

public int getInt(int i)
           throws DatasetException
Description copied from interface: Dataset
Returns int of index i

Throws:
DatasetException - if the data repository produced an error.

getInt

public int getInt(FieldName id)
           throws DatasetException
Description copied from interface: Dataset
Returns int of name id

Throws:
DatasetException - if the data repository produced an error.

getObject

public Object getObject(int i)
                 throws DatasetException
Description copied from interface: Dataset
Returns Object of index i

Throws:
DatasetException - if the data repository produced an error.

getObject

public Object getObject(FieldName id)
                 throws DatasetException
Description copied from interface: Dataset
Returns Object of name id

Throws:
DatasetException - if the data repository produced an error.

getString

public String getString(int i)
                 throws DatasetException
Description copied from interface: Dataset
Returns String of index i.

Throws:
DatasetException - if the data repository produced an error.

getString

public String getString(FieldName id)
                 throws DatasetException
Description copied from interface: Dataset
Returns String of name id.

Throws:
DatasetException - if the data repository produced an error.

getLong

public long getLong(int i)
             throws DatasetException
Description copied from interface: Dataset
Returns long of index i

Throws:
DatasetException - if the data repository produced an error.

getLong

public long getLong(FieldName id)
             throws DatasetException
Description copied from interface: Dataset
Returns long of name id

Throws:
DatasetException - if the data repository produced an error.

setMetaData

public void setMetaData(MetaData md)

getMetaData

public MetaData getMetaData()
                     throws DataException
Gets the meta data for this data set.

Specified by:
getMetaData in interface Dataset
Overrides:
getMetaData in class AbstractDataset
Returns:
the meta data for this data set.
Throws:
DataException - 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
Overrides:
close in class AbstractDataset
Throws:
DatasetException - if an error happens when closing the Dataset.

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
Overrides:
getNestedSet in class AbstractDataset
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.

getMap

public Map<FieldName,Object> getMap()
                             throws DatasetException
Gets a name-> values map containing the current data row.

Returns:
a Map with the current data row. Cannot return null.
Throws:
DatasetException - if an error happens when creating the Map.