Class MutableRel

  • Direct Known Subclasses:
    MutableBiRel, MutableLeafRel, MutableMultiRel, MutableSingleRel

    public abstract class MutableRel
    extends java.lang.Object
    Mutable equivalent of RelNode.

    Each node has mutable state, and keeps track of its parent and position within parent. It doesn't make sense to canonize MutableRels, otherwise one node could end up with multiple parents. It follows that #hashCode and #equals are less efficient than their RelNode counterparts. But, you don't need to copy a MutableRel in order to change it. For this reason, you should use MutableRel for short-lived operations, and transcribe back to RelNode when you are done.

    • Field Detail


        protected static final<java.lang.Object> STRING_EQUIVALENCE
        Equivalence that compares objects by their Object.toString() method.

        protected static final<java.util.List<?>> PAIRWISE_STRING_EQUIVALENCE
        Equivalence that compares Listss by the Object.toString() of their elements.
      • ordinalInParent

        protected int ordinalInParent
    • Method Detail

      • setInput

        public abstract void setInput​(int ordinalInParent,
                                      MutableRel input)
      • getInputs

        public abstract java.util.List<MutableRel> getInputs()
      • clone

        public abstract MutableRel clone()
        clone in class java.lang.Object
      • childrenAccept

        public abstract void childrenAccept​(MutableRelVisitor visitor)
      • replaceInParent

        public MutableRel replaceInParent​(MutableRel child)
        Replaces this MutableRel in its parent with another node at the same position.

        Before the method, child must be an orphan (have null parent) and after this method, this MutableRel is an orphan.

        The parent
      • digest

        public abstract java.lang.StringBuilder digest​(java.lang.StringBuilder buf)
      • deep

        public final java.lang.String deep()
      • toString

        public final java.lang.String toString()
        toString in class java.lang.Object