@Override
  public boolean hasNext() {
    while (nextMatchedNode == null) {
      if (directChildrenIterator.hasNext()) {
        nextMatchedNode = directChildrenIterator.next();
        usingDirectChildrenIterator = true;
      } else if (!skipTemplateChildren
          && templateChildrenIterator != null
          && templateChildrenIterator.hasNext()) {
        nextMatchedNode = templateChildrenIterator.next();
        usingDirectChildrenIterator = false;
      } else {
        return false;
      }
      if (skipPreDeletedSchema
          && nextMatchedNode.isMeasurement()
          && nextMatchedNode.getAsMeasurementMNode().isPreDeleted()) {
        nextMatchedNode = null;
      }
    }
    return true;
  }
TraverserIterator for traversing device node. The iterator returns the filtered child nodes in
the mtree and the child nodes in the template.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/schemaengine/schemaregion/mtree/impl/mem/mnode/iterator/AbstractTraverserIterator.java