proper.database
Class Join

java.lang.Object
  extended by proper.database.Join
All Implemented Interfaces:
java.lang.Comparable, Assignable

public class Join
extends java.lang.Object
implements java.lang.Comparable, Assignable

This class is used for storing join conditions.

Version:
$Revision: 1.2 $
Author:
FracPete

Constructor Summary
Join(Column colLeft, Column colRight)
          sets the local and foreign tables/columns, with size 0 and type Types.OTHER
Join(Column colLeft, int size, Column colRight)
          sets the local and foreign tables/columns, with the given local size and type Types.OTHER
Join(Column colLeft, int size, Column colRight, int type)
          sets the local and foreign tables/columns, with the given local size and the specified type
Join(java.lang.String tableLeft, java.lang.String columnLeft, int size, java.lang.String tableRight, java.lang.String columnRight)
          sets table and column for both, the local and the foreign table, no size and Types.OTHER as type
Join(java.lang.String tableLeft, java.lang.String columnLeft, int size, java.lang.String tableRight, java.lang.String columnRight, int type)
          sets table and column for both, the local and the foreign table, no size and the given type
Join(java.lang.String tableLeft, java.lang.String columnLeft, java.lang.String tableRight, java.lang.String columnRight)
          sets table and column for both, the local and the foreign table, with no size and type Types.OTHER
 
Method Summary
 void assign(java.lang.Object o)
          retrieves the inner state of the given object and updates its own state with those settings
 int compareTo(java.lang.Object o)
          compares the given object to itself, depending on the sorting
 boolean equals(java.lang.Object obj)
          checks whether the objects are the same
 java.lang.String getLeft()
          returns the local table and column, separated by ".".
 java.lang.String getLeftColumn()
          returns the local column name
 Column getLeftObject()
          returns the local column object
 java.lang.String getLeftTable()
          returns the local table
 java.lang.String getRight()
          returns the foreign table and column, separated by ".".
 java.lang.String getRightColumn()
          returns the foreign column name
 Column getRightObject()
          returns the foreign column object
 java.lang.String getRightTable()
          returns the foreign table
 int getSize()
          returns the number of rows of the local table
 int getType()
          the type of the columns
static void main(java.lang.String[] args)
          for testing only
static Join parseString(java.lang.String s)
          generates a join from the given string
 void setSize(int size)
          sets the size (number of rows) of the local table
 java.lang.String toString()
          returns the local table
 java.lang.String toStringJoin()
          returns the complete join if foreign table/column is given, otherwise just the local table
 java.lang.String toStringNode()
          returns a string used in JoinTreeNode
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Join

public Join(java.lang.String tableLeft,
            java.lang.String columnLeft,
            java.lang.String tableRight,
            java.lang.String columnRight)
sets table and column for both, the local and the foreign table, with no size and type Types.OTHER

Parameters:
tableLeft - the local table
columnLeft - the local column
tableRight - the foreign table
columnRight - the foreign column
See Also:
Types.OTHER

Join

public Join(java.lang.String tableLeft,
            java.lang.String columnLeft,
            int size,
            java.lang.String tableRight,
            java.lang.String columnRight)
sets table and column for both, the local and the foreign table, no size and Types.OTHER as type

Parameters:
tableLeft - the local table
columnLeft - the local column
size - the local number of rows
tableRight - the foreign table
columnRight - the foreign column
See Also:
Types.OTHER

Join

public Join(java.lang.String tableLeft,
            java.lang.String columnLeft,
            int size,
            java.lang.String tableRight,
            java.lang.String columnRight,
            int type)
sets table and column for both, the local and the foreign table, no size and the given type

Parameters:
tableLeft - the local table
columnLeft - the local column
size - the local number of rows
tableRight - the foreign table
columnRight - the foreign column
type - the SQL type of the column
See Also:
Types

Join

public Join(Column colLeft,
            Column colRight)
sets the local and foreign tables/columns, with size 0 and type Types.OTHER

Parameters:
colLeft - the local column
colRight - the foreign column
See Also:
Types.OTHER

Join

public Join(Column colLeft,
            int size,
            Column colRight)
sets the local and foreign tables/columns, with the given local size and type Types.OTHER

Parameters:
colLeft - the local column
size - the size of the join
colRight - the foreign column
See Also:
Types.OTHER

Join

public Join(Column colLeft,
            int size,
            Column colRight,
            int type)
sets the local and foreign tables/columns, with the given local size and the specified type

Parameters:
colLeft - the local column
size - the size of the join
colRight - the foreign column
type - the SQL type of the
See Also:
Types
Method Detail

getLeftTable

public java.lang.String getLeftTable()
returns the local table


getLeftColumn

public java.lang.String getLeftColumn()
returns the local column name


getLeftObject

public Column getLeftObject()
returns the local column object


setSize

public void setSize(int size)
sets the size (number of rows) of the local table


getSize

public int getSize()
returns the number of rows of the local table


getType

public int getType()
the type of the columns

See Also:
Types

getRightTable

public java.lang.String getRightTable()
returns the foreign table


getRightColumn

public java.lang.String getRightColumn()
returns the foreign column name


getRightObject

public Column getRightObject()
returns the foreign column object


getLeft

public java.lang.String getLeft()
returns the local table and column, separated by ".".


getRight

public java.lang.String getRight()
returns the foreign table and column, separated by ".".


assign

public void assign(java.lang.Object o)
retrieves the inner state of the given object and updates its own state with those settings

Specified by:
assign in interface Assignable
Parameters:
o - the object to retrieve the inner state from

compareTo

public int compareTo(java.lang.Object o)
              throws java.lang.ClassCastException
compares the given object to itself, depending on the sorting

Specified by:
compareTo in interface java.lang.Comparable
Throws:
java.lang.ClassCastException

equals

public boolean equals(java.lang.Object obj)
checks whether the objects are the same

Overrides:
equals in class java.lang.Object

toStringJoin

public java.lang.String toStringJoin()
returns the complete join if foreign table/column is given, otherwise just the local table


toStringNode

public java.lang.String toStringNode()
returns a string used in JoinTreeNode

See Also:
JoinTreeNode

toString

public java.lang.String toString()
returns the local table

Overrides:
toString in class java.lang.Object

parseString

public static Join parseString(java.lang.String s)
generates a join from the given string

Returns:
the Join generated from the string

main

public static void main(java.lang.String[] args)
for testing only