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

java.lang.Object
  extended by pl.edu.agh.cast.model.base.DataImporter

Deprecated.

public class DataImporter
extends Object

Abstract data importer. It is used only for testing purpose in small installations.

Author:
AGH CAST Team

Constructor Summary
DataImporter(IModel newModel)
          Deprecated. Constructor which binds the loader to the given model.
 
Method Summary
static IEntity getEntity(String id, Map<String,IEntity> entities)
          Deprecated. Returns an IEntity with given id, or creates a new one.
static String getName(String path)
          Deprecated. Return the name of new data set.
static void importData(DataRow tokens, IDataSet dataSet, Map<String,IEntity> entities)
          Deprecated. Transforms the tokens to 2 entities and 1 relation and puts the relation in the dataSet.
 IDataSet importDataFromFile(String path)
          Deprecated. Imports the data from the file given as parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataImporter

public DataImporter(IModel newModel)
Deprecated. 
Constructor which binds the loader to the given model.

Parameters:
newModel - The model to be bounded to.
Method Detail

importDataFromFile

public IDataSet importDataFromFile(String path)
                            throws IOException
Deprecated. 
Imports the data from the file given as parameter.

Parameters:
path - The path of the file.
Returns:
Data set containing abstract model with data loaded from file.
Throws:
IOException

importData

public static void importData(DataRow tokens,
                              IDataSet dataSet,
                              Map<String,IEntity> entities)
Deprecated. 
Transforms the tokens to 2 entities and 1 relation and puts the relation in the dataSet.

Parameters:
tokens - Array of strings holding values of the 2 entities and relation (first entity, second entity, relation start date, duration)
dataSet - The data set where the relation is put
entities - Entities map: entityId => Entity

getEntity

public static IEntity getEntity(String id,
                                Map<String,IEntity> entities)
Deprecated. 
Returns an IEntity with given id, or creates a new one.

Parameters:
id - The id of the entity.
entities - Entities map.
Returns:
The entity with given id.

getName

public static String getName(String path)
Deprecated. 
Return the name of new data set. At this moment the name of the data set is the same as the file from which it was created and from actual time, but it should be determined by user.

Parameters:
path - The path to the file
Returns:
The name of the new data set.


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