org.axiondb

Class FromNode

public class FromNode extends Object

A binary tree of tables (or "table like" objects) being selected from. Each element in the tree is either a FromNode or a TableIdentifier or a sub-query.

Version: $Revision: 1.12 $ $Date: 2005/04/01 01:35:26 $

Author: Amrish Lal

Field Summary
static intTYPE_INNER
Inner join.
static intTYPE_LEFT
Left outer join
static intTYPE_RIGHT
Right outer join
static intTYPE_SINGLE
No Join
Constructor Summary
FromNode()
Method Summary
SelectablegetCondition()
get the join condition
ObjectgetLeft()
Get the Left input
ObjectgetRight()
get the right input
intgetTableCount()
Number of tables in this FromNode and its children.
intgetType()
get the type of the join
booleanhasCondition()
booleanhasLeft()
booleanhasRight()
booleanisInnerJoin()
booleanisLeftJoin()
booleanisRightJoin()
voidsetCondition(Selectable condition)
Set the join condition
voidsetLeft(FromNode join)
voidsetLeft(Object table)
voidsetRight(FromNode join)
voidsetRight(Object table)
voidsetType(int type)
Set the type of join.
StringtoString()
TableIdentifier[]toTableArray()
Array of tables in this FromNode or its children.
static StringtypeToString(int type)

Field Detail

TYPE_INNER

public static final int TYPE_INNER
Inner join.

TYPE_LEFT

public static final int TYPE_LEFT
Left outer join

TYPE_RIGHT

public static final int TYPE_RIGHT
Right outer join

TYPE_SINGLE

public static final int TYPE_SINGLE
No Join

Constructor Detail

FromNode

public FromNode()

Method Detail

getCondition

public Selectable getCondition()
get the join condition

Returns: join condition.

getLeft

public Object getLeft()
Get the Left input

Returns: Object of type FromNodeor TableIdentifier

getRight

public Object getRight()
get the right input

Returns: Object of type FromNodeor TableIdentifier

getTableCount

public int getTableCount()
Number of tables in this FromNode and its children.

Returns: table count.

getType

public int getType()
get the type of the join

Returns: integer indicating type (UNDEFINED, LEFT OUTER, RIGHT OUTER, INNER)

hasCondition

public boolean hasCondition()

hasLeft

public boolean hasLeft()

hasRight

public boolean hasRight()

isInnerJoin

public boolean isInnerJoin()

isLeftJoin

public boolean isLeftJoin()

isRightJoin

public boolean isRightJoin()

setCondition

public void setCondition(Selectable condition)
Set the join condition

Parameters: type condition Join condition.

setLeft

public void setLeft(FromNode join)

setLeft

public void setLeft(Object table)

setRight

public void setRight(FromNode join)

setRight

public void setRight(Object table)

setType

public void setType(int type)
Set the type of join.

Parameters: type integer value representing join type (INNER, LEFT OUTER, RIGHT OUTER)

toString

public String toString()

toTableArray

public TableIdentifier[] toTableArray()
Array of tables in this FromNode or its children. Array is devleoped by preorder traversal of the FromNode tree.

Returns: Array of TableIdentifier

typeToString

public static String typeToString(int type)