Class InvariantChecker


  • public class InvariantChecker
    extends java.lang.Object
    Noextend:
    This class is not intended to be subclassed by clients.
    • Constructor Detail

      • InvariantChecker

        public InvariantChecker()
    • Method Detail

      • checkInvariant

        public void checkInvariant​(INode node)
                            throws InvariantChecker.InconsistentNodeModelException
        Assert the invariant of completely build node model. Checks that every pointer is correct, e.g.
        • a parent points to its first child,
        • siblings point to the very same parent,
        • the offset and length data is in sync, and
        • no null fields are present (besides some empty first child pointers).
        Parameters:
        node - an arbitrary node of the complete node model that should be checked.
        Throws:
        InvariantChecker.InconsistentNodeModelException - if the node is part of an inconsistent node tree.
      • doCheckInvariant

        protected void doCheckInvariant​(ICompositeNode rootNode)
      • doCheckCompositeNodeAndReturnTotalLength

        protected int doCheckCompositeNodeAndReturnTotalLength​(ICompositeNode node,
                                                               int startsAt)
      • doCheckChildNodeAndReturnTotalLength

        protected int doCheckChildNodeAndReturnTotalLength​(INode child,
                                                           ICompositeNode parent,
                                                           int startsAt)
      • doCheckLeafNodeAndReturnLength

        protected int doCheckLeafNodeAndReturnLength​(ILeafNode leafNode,
                                                     int startsAt)