/* (non-Javadoc) * @see cs127db.server.sql.nodes.Node#equals(java.lang.Object) */ @Override public boolean equals(Object other) { if ((other == null) || !(other instanceof NodeCondition)) { return false; } NodeCondition otherCondition = (NodeCondition) other; boolean areColumnsEqual = m_lhs.equals(otherCondition.m_lhs); boolean areCondOpsEqual = false; if (m_condop == null) { areCondOpsEqual = (otherCondition.m_condop == null); } else { areCondOpsEqual = m_condop.equals(otherCondition.m_condop); } boolean areNextsEqual = false; if (m_rhs == null) { areNextsEqual = (otherCondition.m_rhs == null); } else { areNextsEqual = m_rhs.equals(otherCondition.m_rhs); } return areCondOpsEqual && areColumnsEqual && areNextsEqual; }
/* * (non-Javadoc) * * @see cs127db.server.sql.nodes.Node#visit(cs127db.server.sql.Visitor) */ @Override public void visit(BDVisitor visitor) { visitor.handleCondition(this); m_lhs.visit(visitor); m_condop.visit(visitor); m_rhs.visit(visitor); }