public void toLeftJoin ( ) { assert ( ( m_leftNode != null && m_rightNode != null ) || ( m_leftNode == null && m_rightNode == null ) ) ; if ( m_leftNode == null && m_rightNode == null ) { // End of recursion return ; } // recursive calls if ( m_leftNode instanceof BranchNode ) { ( ( BranchNode ) m_leftNode ) . toLeftJoin ( ) ; } if ( m_rightNode instanceof BranchNode ) { ( ( BranchNode ) m_rightNode ) . toLeftJoin ( ) ; } // Swap own children if ( m_joinType == JoinType . RIGHT ) { JoinNode node = m_rightNode ; m_rightNode = m_leftNode ; m_leftNode = node ; m_joinType = JoinType . LEFT ; } }
Transform all RIGHT joins from the tree into the LEFT ones by swapping the nodes and their join types