easik.sketch.util.Export.Components
Class ExportTable

java.lang.Object
  extended by easik.sketch.util.Export.Components.ExportTable

public class ExportTable
extends java.lang.Object

Class to hold information about entities gleaned from XML input files. Should only be used for exportation to a database. Does not provide functionality for graphical display.

Since:
2006-05-18 Vera Ranieri
Version:
2006-06-14 Vera Ranieri
Author:
Vera Ranieri 2006

Field Summary
private  java.util.ArrayList<ExportAttribute> _attributes
          The attributes associated with this table
private  java.util.ArrayList<ExportEdge> _edges
          The edges associated with this table
private  boolean _marked
          Stores whether this table has been accessed already.
private  java.lang.String _name
          The name of this table
private  java.util.ArrayList<ExportUniqueKey> _uniqueKeys
          The unique keys associated with this table
 
Constructor Summary
ExportTable(java.lang.String name)
          Constructor initializing fields and setting the name of this table.
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String type, java.util.HashMap map)
          Add an attribute to the arraylist of attributes
 void addEdge(ExportEdge e)
          Add an edge to the arraylist of edges
 void addUniqueKey(ExportUniqueKey uk)
          Add a unique key to the arraylist of unique keys.
 java.util.ArrayList getAttributes()
          Getter method for the list of attributes (that is, table columns)
 java.util.ArrayList getEdges()
          Getter method for the list of edges (that is, foreign keys)
 java.lang.String getName()
          Getter method for the name of the table.
static java.lang.String getPrimaryKeyString(ExportTable t)
          A method to determine the formatting of the primary key portion of table definition and set the relevant string field to this value
 java.util.ArrayList getUniqueKeys()
          Getter method for the list of unique keys
 boolean isMarked()
          Gets whether this table is marked or not.
 void setMarked(boolean mark)
          Sets this table as mark.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

private java.lang.String _name
The name of this table


_edges

private java.util.ArrayList<ExportEdge> _edges
The edges associated with this table


_attributes

private java.util.ArrayList<ExportAttribute> _attributes
The attributes associated with this table


_uniqueKeys

private java.util.ArrayList<ExportUniqueKey> _uniqueKeys
The unique keys associated with this table


_marked

private boolean _marked
Stores whether this table has been accessed already. Used when building all tables.

Constructor Detail

ExportTable

public ExportTable(java.lang.String name)
Constructor initializing fields and setting the name of this table.

Parameters:
name - The name of the table
Method Detail

getName

public java.lang.String getName()
Getter method for the name of the table.

Returns:
The name of the table

getEdges

public java.util.ArrayList getEdges()
Getter method for the list of edges (that is, foreign keys)

Returns:
The list of edges

getAttributes

public java.util.ArrayList getAttributes()
Getter method for the list of attributes (that is, table columns)

Returns:
The list of attributes

getUniqueKeys

public java.util.ArrayList getUniqueKeys()
Getter method for the list of unique keys

Returns:
The list of unique keys
Since:
2006-06-14 Vera Ranieri

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String type,
                         java.util.HashMap map)
Add an attribute to the arraylist of attributes

Parameters:
name - The name of the attribute
type - The attribute type
map - The map associated with this attribute

addEdge

public void addEdge(ExportEdge e)
Add an edge to the arraylist of edges

Parameters:
e - The edge to be added

addUniqueKey

public void addUniqueKey(ExportUniqueKey uk)
Add a unique key to the arraylist of unique keys.

Parameters:
uk - The unique key to be added
Since:
2006-06-14 Vera Ranieri

setMarked

public void setMarked(boolean mark)
Sets this table as mark.

Parameters:
mark - true to mark table, false otherwise

isMarked

public boolean isMarked()
Gets whether this table is marked or not.

Returns:
true if table is marked, false otherwise

getPrimaryKeyString

public static java.lang.String getPrimaryKeyString(ExportTable t)
A method to determine the formatting of the primary key portion of table definition and set the relevant string field to this value

Parameters:
t - The table for which the primary key needs to be determined
Returns:
The primary key string