easik.sketch.util.Export.Components
Class ExportEdge

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

public class ExportEdge
extends java.lang.Object

Class to store edge information. Should only be used for exportation to a database. Does not provide functionality for graphical display.

Since:
2006-05-18 Vera Ranieri
Version:
2006-05-22 Vera Ranieri
Author:
Vera Ranieri 2006

Field Summary
private  boolean _injective
          Stores whether the edge is injective
private  java.lang.String _name
          The name of the edge
private  java.lang.String _source
          The source of the edge
private  java.lang.String _target
          The target of the edges
 
Constructor Summary
ExportEdge(java.lang.String n, boolean injective, java.lang.String source, java.lang.String target)
          Constructor.
 
Method Summary
static java.lang.String getForeignKeyString(ExportTable t)
          Formats the foreign key string for SQL.
 java.lang.String getName()
          Getter method for the name of the edge
 java.lang.String getSource()
          Getter method of the name of the source (that is, domain) of this edge.
 java.lang.String getTarget()
          Getter method of the name of the target (that is, codomain) of this edge.
 boolean isInjective()
          Determines whether an edge is injective.
 
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 the edge


_source

private java.lang.String _source
The source of the edge


_target

private java.lang.String _target
The target of the edges


_injective

private boolean _injective
Stores whether the edge is injective

Constructor Detail

ExportEdge

public ExportEdge(java.lang.String n,
                  boolean injective,
                  java.lang.String source,
                  java.lang.String target)
Constructor. The target of the edge is not allowed to have whitespaces. All contained whitespace is replaced by an underscore.

Parameters:
n - The name of the edge
injective - true if edge is injective, false otherwise
source - The name of the source table
target - The name of the target table
Method Detail

getName

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

Returns:
The name of the edge

isInjective

public boolean isInjective()
Determines whether an edge is injective.

Returns:
true if edge is injective, false otherwise.

getTarget

public java.lang.String getTarget()
Getter method of the name of the target (that is, codomain) of this edge.

Returns:
The target table of the edge

getSource

public java.lang.String getSource()
Getter method of the name of the source (that is, domain) of this edge.

Returns:
The source table of the edge
Since:
2006-05-22

getForeignKeyString

public static java.lang.String getForeignKeyString(ExportTable t)
Formats the foreign key string for SQL. Accepts a table as a parameter. The edges of this table are then used to determine the foreign key string. The foreign key string does not contain any attribute or primary/ unique key definitions, exclusive of unique keys defined because of an injective edge.

Parameters:
t - The table for which the foreign key string should be determined
Returns:
The foreign key string formatted for SQL derived from table t
Since:
2006-06-14