org.axiondb
Class FromNode

java.lang.Object
  extended byorg.axiondb.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.11 $ $Date: 2004/08/27 03:21:20 $

Field Summary
static int TYPE_INNER
          Inner join.
static int TYPE_LEFT
          Left outer join
static int TYPE_RIGHT
          Right outer join
static int TYPE_SINGLE
          No Join
 
Constructor Summary
FromNode()
           
 
Method Summary
 Selectable getCondition()
          get the join condition
 Object getLeft()
          Get the Left input
 Object getRight()
          get the right input
 int getTableCount()
          Number of tables in this FromNode and its children.
 int getType()
          get the type of the join
 boolean hasCondition()
           
 boolean hasLeft()
           
 boolean hasRight()
           
 boolean isInnerJoin()
           
 boolean isLeftJoin()
           
 boolean isRightJoin()
           
 void setCondition(Selectable condition)
          Set the join condition
 void setLeft(FromNode join)
           
 void setLeft(Object table)
           
 void setRight(FromNode join)
           
 void setRight(Object table)
           
 void setType(int type)
          Set the type of join.
 String toString()
           
 TableIdentifier[] toTableArray()
          Array of tables in this FromNode or its children.
static String typeToString(int type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_INNER

public static final int TYPE_INNER
Inner join.

See Also:
Constant Field Values

TYPE_LEFT

public static final int TYPE_LEFT
Left outer join

See Also:
Constant Field Values

TYPE_RIGHT

public static final int TYPE_RIGHT
Right outer join

See Also:
Constant Field Values

TYPE_SINGLE

public static final int TYPE_SINGLE
No Join

See Also:
Constant Field Values
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


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)