pl.edu.agh.cast.data.converter
Class AbstractConverter

java.lang.Object
  extended by pl.edu.agh.cast.data.converter.AbstractConverter
All Implemented Interfaces:
IConverter
Direct Known Subclasses:
GDM2SchemaConverter

public abstract class AbstractConverter
extends Object
implements IConverter

Abstract implementation of IConverter interface.

Author:
AGH CAST Team
See Also:
IConverter

Constructor Summary
protected AbstractConverter(ConverterSpecification specification)
          Constructor.
 
Method Summary
<T extends IDataSet<? extends IElement>>
T
convert(List<? extends IDataSet<? extends IElement>> dataSets)
          Converts given input data sets into a new output data set.
<T extends IDataSet<? extends IElement>>
T
convert(MultiMap<ConverterInputEntry,? extends IDataSet<? extends IElement>> dataSets)
          Converts given input data sets into a new output data set.
protected abstract
<T extends IDataSet<? extends IElement>>
T
doConvert(MultiMap<ConverterInputEntry,? extends IDataSet<? extends IElement>> dataSets)
           
 ConverterSpecification getSpecification()
          Returns the converter specification.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractConverter

protected AbstractConverter(ConverterSpecification specification)
Constructor.

Parameters:
specification - converter specification
Throws:
IllegalArgumentException - if specification is null
Method Detail

convert

public <T extends IDataSet<? extends IElement>> T convert(List<? extends IDataSet<? extends IElement>> dataSets)
                                               throws ConverterException
Converts given input data sets into a new output data set.

Specified by:
convert in interface IConverter
Type Parameters:
T - the type of conversion output data set
Parameters:
dataSets - a list of data sets
Returns:
an instance of a data set of the same type as returned by the #getOutputType() method
Throws:
ConverterException - if the input data sets do not conform to the input entry specification or a data set conversion failed
See Also:
IConverter.convert(java.util.List)

convert

public final <T extends IDataSet<? extends IElement>> T convert(MultiMap<ConverterInputEntry,? extends IDataSet<? extends IElement>> dataSets)
                                                     throws ConverterException
Converts given input data sets into a new output data set.

Specified by:
convert in interface IConverter
Type Parameters:
T - the type of conversion output data set
Parameters:
dataSets - a map of data sets indexed by the input entries returned by the #getInputEntries() method
Returns:
an instance of a data set of the same type as returned by the #getOutputType() method
Throws:
ConverterException - if the input data sets do not conform to the input entry specification or a data set conversion failed
See Also:
pl.edu.agh.cast.data.converter.IConverter#convert(pl.edu.agh.cast.common.collections.collections.MultiMap)

doConvert

protected abstract <T extends IDataSet<? extends IElement>> T doConvert(MultiMap<ConverterInputEntry,? extends IDataSet<? extends IElement>> dataSets)
                                                             throws ConverterException
Throws:
ConverterException

getSpecification

public final ConverterSpecification getSpecification()
Returns the converter specification.

Specified by:
getSpecification in interface IConverter
Returns:
the converter specification
See Also:
IConverter.getSpecification()


Copyright © 2007-2009 IISG AGH-UST Krakow, Poland. All Rights Reserved.