|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--erkka.Relation
Title:
Description: Relation knows all information about a relation(table): tablaName, primarykey, attributes and the list of the lines, whose type is Reference.
Copyright: Copyright (c) 2002
Company: University of Jyväskylä
Constructor Summary | |
Relation()
constructor creates new Relation |
Method Summary | |
void |
createTable(java.io.BufferedReader breader,
java.lang.String line)
creates CREATE TABLE by placing all information at the same line.
|
void |
findAttributes(java.lang.String attriLine)
find attributes modified by Jukka Mäntylä 2005. |
void |
findConstraints(java.lang.String endLine)
find constrains |
java.lang.String |
findFirstWord(java.lang.String line)
return the first word of the line. |
java.util.Vector |
getAttributes()
|
java.util.Vector |
getLines()
|
java.util.Vector |
getPrimarykey()
|
java.lang.String |
getTableName()
|
java.util.Vector |
IncludeOfBracketAsVector(java.lang.String line)
return the include of bracket as Vector. |
boolean |
isPrimaryKey(java.lang.String attrname)
Is primarykey or not |
java.lang.String |
removeEnterInCreateTable(java.io.BufferedReader breader,
java.lang.String line)
Remove all enter from CREATE TABLE to ); -character. |
java.lang.String |
removeExtraSpace(java.lang.String line)
Remove extra spaces. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Relation()
Method Detail |
public java.lang.String getTableName()
public java.util.Vector getPrimarykey()
public java.util.Vector getAttributes()
public java.util.Vector getLines()
public boolean isPrimaryKey(java.lang.String attrname)
Is primarykey or not
attrname
- Name of attribute
public java.lang.String removeEnterInCreateTable(java.io.BufferedReader breader, java.lang.String line)
Remove all enter from CREATE TABLE
to ); -character.
breader
- line
- line whice is readed, not include CREATE TABLE
-word
public java.lang.String removeExtraSpace(java.lang.String line)
Remove extra spaces. After this method there can be only one space between two words. Remove all spaces at the begin of the line.
line
- whice we are reading
public void createTable(java.io.BufferedReader breader, java.lang.String line) throws java.lang.Exception
creates CREATE TABLE
by placing all information at the same line.
The line is devided to attributeLine and endLine, then is asked
functions findAttributes
and findConstraints
1.line:CREATE TABLE
2.line:Osasto(OsastoID INTEGER NOT NULL,OsastoNimi VARCHAR(32)....
breader
- line
- the first index of line is the first character
after CREATE TABLE
and the last character is );
java.lang.Exception
public void findAttributes(java.lang.String attriLine)
find attributes
modified by Jukka Mäntylä 2005. Bugfix for attributes like NUMERIC(7,2)
attriLine
- AttriLine begin with first attribute and end with word
before CONSTRAINT
. The first character of the attriLine
can't be empty and the last don't get be comma.public void findConstraints(java.lang.String endLine) throws java.lang.Exception
find constrains
endLine
- the first character of the endLine is C (CONSTRAINT
)
and the last character is );
java.lang.Exception
public java.util.Vector IncludeOfBracketAsVector(java.lang.String line)
return the include of bracket as Vector.
line
-
public java.lang.String findFirstWord(java.lang.String line)
return the first word of the line.
line
- firts character dont't get be empty
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |