pl.edu.agh.cast.model.base
Class AbstractModelDataLoader

java.lang.Object
  extended by pl.edu.agh.cast.model.base.AbstractDataLoaderWithStatistics
      extended by pl.edu.agh.cast.model.base.AbstractModelDataLoader
All Implemented Interfaces:
IDataLoader

public class AbstractModelDataLoader
extends AbstractDataLoaderWithStatistics

Implementation of abstract model loader which converts input data into data sets with TimedRelation between Entities. One TimedRelation requires two nodes and optional date

Author:
AGH CAST Team

Constructor Summary
AbstractModelDataLoader()
           
 
Method Summary
protected  void importRow(DataRow row, Map<Integer,Integer> mapping, BrokenRowInfo brokenRowInfo, IDataSet dataSet, Map<String,IEntity> entities)
          Creates one relation based on given data row.
 IDataSet loadData(TabularData data, Map<Integer,Integer> modelToDataMapping, BrokenDataInfo brokenDataInfo)
          Transforms the data given as tabular data to abstract model data set.
 BrokenDataInfo validateData(TabularData data, Map<Integer,Integer> modelToDataMapping)
          Transforms the data given as tabular data to abstract model data set.
 BrokenRowInfo validateRow(DataRow row, Map<Integer,Integer> modelToDataMapping)
          Validates given data row.
 
Methods inherited from class pl.edu.agh.cast.model.base.AbstractDataLoaderWithStatistics
loadData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractModelDataLoader

public AbstractModelDataLoader()
Method Detail

loadData

public IDataSet loadData(TabularData data,
                         Map<Integer,Integer> modelToDataMapping,
                         BrokenDataInfo brokenDataInfo)
Transforms the data given as tabular data to abstract model data set.

Specified by:
loadData in class AbstractDataLoaderWithStatistics
Parameters:
data - The tabular data to be transformed.
modelToDataMapping - The model to data mapping
brokenDataInfo - The object which contains the informations about invalid data.
Returns:
The data set containing abstract model.

validateData

public BrokenDataInfo validateData(TabularData data,
                                   Map<Integer,Integer> modelToDataMapping)
Transforms the data given as tabular data to abstract model data set.

Specified by:
validateData in class AbstractDataLoaderWithStatistics
Parameters:
data - The tabular data to be transformed.
modelToDataMapping - The model to data mapping
Returns:
The data set containing abstract model.

validateRow

public BrokenRowInfo validateRow(DataRow row,
                                 Map<Integer,Integer> modelToDataMapping)
Validates given data row.

Specified by:
validateRow in class AbstractDataLoaderWithStatistics
Parameters:
row - Row to validate.
modelToDataMapping - The model to data mapping
Returns:
BrokenRowInfo if the row is invalid, null otherwise.

importRow

protected void importRow(DataRow row,
                         Map<Integer,Integer> mapping,
                         BrokenRowInfo brokenRowInfo,
                         IDataSet dataSet,
                         Map<String,IEntity> entities)
Creates one relation based on given data row.

Parameters:
row - The row to be converted to the relation.
mapping - The model to data mapping.
brokenRowInfo - The object for storing info about invalid data.
dataSet - The data which the relation is to be placed in.
entities - The entities cache providing referential integrity.


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