pedviz.loader
Class DatabaseGraphLoader

java.lang.Object
  extended by pedviz.loader.Loader
      extended by pedviz.loader.DatabaseGraphLoader

public class DatabaseGraphLoader
extends Loader

This Loader class allow you to load a graph directly from a database. It's possible to load the whole table or to define your own querie.

Data can be imported from any Java supported relational database. At the moment loader classes for mysql (MySQLDatabase), hdbsql (HSQLDatabase) and postgresSQL (PostgreSQLDatabase) are available. Furthermore, it's mandatory to set the mapping for the following fields: id, mom's id and dad's id (Method: setSettings). Additional fields (that maybe are available in the data), such as sex, traits etc. are mapped as Rules.

Version:
0.1
Author:
Lukas Forer

Constructor Summary
DatabaseGraphLoader(Database database, java.lang.String table)
          Constructs a new DatabaseGraphLoader with the given connection and the table name.
 
Method Summary
 java.util.ArrayList<java.lang.String> getAttributes()
          Returns a collection of all attributes.
 java.util.Vector<java.lang.String> getColumns()
          Returns a array of all columns.
 void load(Graph graph)
          Loads data in the given Graph object.
 void setQuery(java.lang.String query)
          Sets a query.
 
Methods inherited from class pedviz.loader.Loader
getDadColumn, getIdColumn, getMomColumn, setSettings
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseGraphLoader

public DatabaseGraphLoader(Database database,
                           java.lang.String table)
Constructs a new DatabaseGraphLoader with the given connection and the table name.

Parameters:
connection - Connection object
table - tablename
Method Detail

setQuery

public void setQuery(java.lang.String query)
Sets a query.

Parameters:
query -

load

public void load(Graph graph)
Description copied from class: Loader
Loads data in the given Graph object.

Specified by:
load in class Loader
Parameters:
graph - Gaph object.

getColumns

public java.util.Vector<java.lang.String> getColumns()
Description copied from class: Loader
Returns a array of all columns.

Specified by:
getColumns in class Loader
Returns:
a array of all columns.

getAttributes

public java.util.ArrayList<java.lang.String> getAttributes()
Returns a collection of all attributes.

Returns:
a collection of all attributes.