|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--EVEDemo.SWEEP.Element | +--EVEDemo.SWEEP.StampedElement | +--EVEDemo.SWEEP.Relation
This is a class represent a Relational Database Table. We can create it from: 1. null 2. ResultSet from JDBC 3. File created by write() method We can following operations on it: 1. Join 2. Plus 3. Minus 4. Projection 5. delColumn Tuple Format: (values)[number] e.g. (5,6)[3] means we have three duplicate (5,6) tuples.
Field Summary | |
(package private) java.lang.String |
alias
Alias of this Relation. |
(package private) static int |
objnum
debug variable to trace how many relation object created. |
(package private) RelationExtent |
theExtent
|
(package private) java.lang.String |
theName
|
(package private) RelationSchema |
theSchema
|
Fields inherited from class EVEDemo.SWEEP.StampedElement |
id,
TimeStamp |
Constructor Summary | |
private |
Relation()
|
|
Relation(java.io.FileInputStream fin)
|
|
Relation(java.sql.ResultSet rs,
java.lang.String newName)
this is a constructor of Relation from result set. |
|
Relation(java.sql.ResultSet rs,
java.lang.String newName,
Relation localrel,
java.lang.String sign)
This constructor will create a Relation from Resultset. |
|
Relation(java.sql.ResultSet rs,
java.lang.String newName,
java.lang.String sign)
This constructor will create a Relation from Resultset. |
|
Relation(java.sql.ResultSet rs,
java.lang.String newName,
java.lang.String sign1,
java.lang.String sign2)
This constructor will create a Relation from Resultset. |
|
Relation(java.lang.String newName)
|
Method Summary | |
java.lang.Object |
clone()
|
java.lang.String |
createTableSQL()
|
java.lang.String |
createTableSQL(java.lang.String sign)
This function will create a table with sign field. |
void |
delCol(java.lang.String colName)
Delete one column from the Relation |
void |
finalize()
|
java.lang.String |
getAlias()
|
int |
getCardinality()
|
java.lang.String |
getCommon(Relation theRelation)
|
RelationExtent |
getExtent()
|
java.lang.String |
getName()
|
RelationSchema |
getSchema()
get Schema of this Relation. |
void |
initIterator()
Cooperate with moreTuple and InsertTupleSQL, TupleSQL. |
void |
insertTuple(Tuple newTuple)
|
int |
insertTupleSQL(java.lang.StringBuffer Query)
Cooperate with moreTuple and initIterator. |
int |
insertTupleSQL(java.lang.StringBuffer Query,
java.lang.String sign)
Cooperate with moreTuple and initIterator. |
Relation |
join(Relation sndRelation)
This method will join two relations and return the result. |
Relation |
joinVirtual(Relation sndRelation)
This method will join two relations and return the result. |
Relation |
joinVirtualOn(Relation sndRelation,
java.util.Hashtable JCAttrs)
This method will join two relations and return the result. |
private java.lang.String |
makeConditions(java.lang.StringBuffer tupleValues)
This function will generate the conditions from Relation Schema and the Tuple This function should be only used by method: insertTupleSQL(). |
Relation |
minus(Relation sndRelation)
|
boolean |
moreTuple()
Cooperate with initIterator and InsertTupleSQL, TupleSQL. |
Relation |
plus(Relation sndRelation)
|
void |
projectOn(Relation Rel)
Do Project Operation. |
void |
rename(java.lang.String newName)
Give this Relation a new name |
void |
setAlias(java.lang.String newname)
|
void |
setExtent(RelationExtent newExtent)
This function set the new extent of this relation. |
void |
setName(java.lang.String newName)
Set New name for this relation. |
void |
setSchema(RelationSchema newSchema)
|
java.lang.String |
toString()
Convert Relation to String |
int |
updateTupleSQL(java.lang.StringBuffer Query)
Cooperate with moreTuple and initIterator. |
void |
write(java.io.FileOutputStream fout)
|
Methods inherited from class EVEDemo.SWEEP.StampedElement |
getTimeStamp,
OlderThan,
setTimeStamp |
Methods inherited from class java.lang.Object |
|
Field Detail |
java.lang.String theName
java.lang.String alias
RelationSchema theSchema
RelationExtent theExtent
static int objnum
Constructor Detail |
private Relation()
public Relation(java.sql.ResultSet rs, java.lang.String newName) throws java.lang.Exception
public Relation(java.sql.ResultSet rs, java.lang.String newName, java.lang.String sign) throws java.lang.Exception
public Relation(java.sql.ResultSet rs, java.lang.String newName, Relation localrel, java.lang.String sign) throws java.lang.Exception
public Relation(java.sql.ResultSet rs, java.lang.String newName, java.lang.String sign1, java.lang.String sign2) throws java.lang.Exception
public Relation(java.lang.String newName)
public Relation(java.io.FileInputStream fin)
Method Detail |
public void finalize()
public java.lang.Object clone()
public void setExtent(RelationExtent newExtent)
public java.lang.String getAlias()
public void setAlias(java.lang.String newname)
public void setSchema(RelationSchema newSchema)
public void insertTuple(Tuple newTuple) throws java.lang.Exception
public java.lang.String createTableSQL()
public java.lang.String createTableSQL(java.lang.String sign)
public void initIterator()
public boolean moreTuple()
public int updateTupleSQL(java.lang.StringBuffer Query)
public int insertTupleSQL(java.lang.StringBuffer Query)
public int insertTupleSQL(java.lang.StringBuffer Query, java.lang.String sign)
private java.lang.String makeConditions(java.lang.StringBuffer tupleValues) throws java.lang.Exception
public java.lang.String getName()
public java.lang.String getCommon(Relation theRelation)
public RelationExtent getExtent()
public void write(java.io.FileOutputStream fout)
public Relation minus(Relation sndRelation) throws java.lang.Exception
public Relation plus(Relation sndRelation)
public Relation join(Relation sndRelation)
public Relation joinVirtual(Relation sndRelation)
public Relation joinVirtualOn(Relation sndRelation, java.util.Hashtable JCAttrs)
public int getCardinality()
public java.lang.String toString()
public void rename(java.lang.String newName)
public void projectOn(Relation Rel) throws java.lang.Exception
public RelationSchema getSchema()
public void setName(java.lang.String newName)
public void delCol(java.lang.String colName)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |