|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.relaggs.RelaggsTable
public class RelaggsTable
Title: RelaggsTable Description: Represents a table. Copyright: (c) 2002 Susanne Streuer
Field Summary | |
---|---|
static java.lang.String |
SHORT_NAME_PREFIX
The general short name prefix. |
static java.lang.String |
SHORT_NAME_PREFIX_TMP
The temporary short name prefix. |
Constructor Summary | |
---|---|
RelaggsTable(java.lang.String table_name)
Creates a new RelaggsTable with the given name. |
Method Summary | |
---|---|
boolean |
addAttribute(RelaggsAttribute attribute)
Adds a new attribute to the table. |
void |
addForeignKey(RelaggsTable ref_table)
Adds the foreign keys to the given table (if exist) to the table. |
boolean |
addPrimaryKey(java.lang.String prim_key)
Adds a primary key to the table. |
java.lang.Object |
clone()
Returns a clone of the table. |
int |
compareTo(java.lang.Object o)
Compares another table to this table. |
boolean |
equals(java.lang.Object obj)
Returns true if the object is a RelaggsTable object and the name equals this one. |
RelaggsAttribute |
getAttribute(java.lang.String name)
returns the attribute object for the given name. |
java.util.Enumeration |
getAttributes()
Returns an Enumeration of the attributes (RelaggsAttribute objects) of the table. |
java.util.Iterator |
getAttributesOrdered()
Returns an Iterator of the attributes (RelaggsAttribute objects) of the table in alphabetic order. |
int |
getColumnCount()
returns the number of columns currently in this table |
java.util.HashSet |
getColumns()
returns the HashSet containing the current columns in this table |
int |
getMaxColumns()
returns the max number of columns for a table, -1 means uninitialized |
java.lang.String |
getName()
Returns the name of the table. |
int |
getNumberAttributes()
Returns the number of attributes of the table. |
int |
getNumForeignKeys()
Returns the number of foreign keys of the table. |
java.util.Enumeration |
getPrimaryKeys()
Returns an Enumeration of the primary key attributes (RelaggsAttribute objects) of the table. |
int |
getRowNumber()
Returns the number of rows of the table. |
java.lang.String |
getShortName()
Returns the short name of the table. |
boolean |
hasForeignKey(RelaggsTable ref_table)
Returns whether the table references the given table by foreign key or not. |
boolean |
isAttribute(java.lang.String attribute_name)
Returns whether the given attribute is a attribute of the table (true) or not (false). |
boolean |
isForeignKey(java.lang.String attribute_name)
Returns whether the given attribute is a foreign key of the table (true) or not (false). |
boolean |
isPrimaryKey(java.lang.String attribute_name)
Returns whether the given attribute is a primary key of the table (true) or not (false). |
void |
setMaxColumns(int maxColumns)
sets the number of max columns for a table |
void |
setRowNumber(int value)
Sets the number of rows for the table. |
void |
setShortName(int number)
Sets the short name of the table to the general short name prefix followed by the given number. |
void |
setShortName(int number,
boolean is_tmp)
Sets the short name of the table to the general short name prefix followed by the given number if the table is a regular table. |
void |
setShortName(java.lang.String short_name)
Sets the short name of the table to the given name. |
java.lang.String |
toString()
Returns the name of the table. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String SHORT_NAME_PREFIX
public static final java.lang.String SHORT_NAME_PREFIX_TMP
Constructor Detail |
---|
public RelaggsTable(java.lang.String table_name)
table_name
- name of the tableMethod Detail |
---|
public void setMaxColumns(int maxColumns)
public int getMaxColumns()
public java.util.HashSet getColumns()
public int getColumnCount()
public java.lang.String toString()
toString
in class java.lang.Object
public void setRowNumber(int value)
value
- the number of rowspublic int getRowNumber()
public void setShortName(java.lang.String short_name)
short_name
- the new short namepublic void setShortName(int number)
number
- the number that is appended to the general
short name prefixpublic void setShortName(int number, boolean is_tmp)
number
- the number that is appendedis_tmp
- flag defining whether the table is temporary
(true) or not (false)public java.lang.String getShortName()
public boolean hasForeignKey(RelaggsTable ref_table)
ref_table
- the table that should be referenced by this table
public java.util.Enumeration getPrimaryKeys()
public boolean addAttribute(RelaggsAttribute attribute)
attribute
- the attribute to add
public boolean addPrimaryKey(java.lang.String prim_key)
prim_key
- the name of the primary key attribute
public void addForeignKey(RelaggsTable ref_table)
ref_table
- the table that is referenced in this table by
a foreign key (is not neccessary)public java.lang.Object clone()
clone
in class java.lang.Object
public java.util.Enumeration getAttributes()
public java.util.Iterator getAttributesOrdered()
public RelaggsAttribute getAttribute(java.lang.String name)
name
- the name of the attribute to retrieve
public java.lang.String getName()
public int getNumberAttributes()
public int getNumForeignKeys()
public boolean isPrimaryKey(java.lang.String attribute_name)
attribute_name
- the name of the attribute to checkpublic boolean isForeignKey(java.lang.String attribute_name)
attribute_name
- the name of the attribute to checkpublic boolean isAttribute(java.lang.String attribute_name)
attribute_name
- the name of the attribute to checkpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- the object to compare
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |