gpt4 book ai didi

org.onosproject.yang.compiler.datamodel.YangNode.setChild()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 13:23:31 26 4
gpt4 key购买 nike

本文整理了Java中org.onosproject.yang.compiler.datamodel.YangNode.setChild()方法的一些代码示例,展示了YangNode.setChild()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YangNode.setChild()方法的具体详情如下:
包路径:org.onosproject.yang.compiler.datamodel.YangNode
类名称:YangNode
方法名:setChild

YangNode.setChild介绍

[英]Sets the first instance of a child node.
[中]设置子节点的第一个实例。

代码示例

代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel

@Override
public YangNode clone(YangUses node, boolean isDeviation, boolean isAnyData) throws
    CloneNotSupportedException {
  YangNode clnNode = (YangNode) super.clone();
  clnNode.setParent(null);
  clnNode.setChild(null);
  clnNode.setNextSibling(null);
  clnNode.setPreviousSibling(null);
  return clnNode;
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-linker

private static void processHierarchyChild(YangNode node,
                     Map<YangNode, List<YangNode>> map) {
  YangNode child = node.getChild();
  if (child != null) {
    List<YangNode> nodes = new ArrayList<>();
    while (child != null) {
      nodes.add(child);
      child.setParent(null);
      child = child.getNextSibling();
      if (child != null) {
        child.getPreviousSibling().setNextSibling(null);
        child.setPreviousSibling(null);
      }
    }
    map.put(node, nodes);
  }
  node.setChild(null);
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel

clonedNode.setChild(null);
clonedNode.setNextSibling(null);
clonedNode.setPreviousSibling(null);

代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel

/**
 * Removes node from data model tree.
 *
 * @param node YANG data model node
 */
public static void deleteUnsupportedNodeFromTree(YangNode node) {
  // unlink from parent
  YangNode parentNode = node.getParent();
  if (parentNode.getChild().equals(node)) {
    parentNode.setChild(node.getNextSibling());
  }
  //unlink from siblings
  YangNode previousSibling = node.getPreviousSibling();
  YangNode nextSibling = node.getNextSibling();
  if (nextSibling != null && previousSibling != null) {
    previousSibling.setNextSibling(nextSibling);
    nextSibling.setPreviousSibling(previousSibling);
  } else if (nextSibling != null) {
    nextSibling.setPreviousSibling(null);
  } else if (previousSibling != null) {
    previousSibling.setNextSibling(null);
  }
  node.setParent(null);
  node.setPreviousSibling(null);
  node.setNextSibling(null);
  node.setChild(null);
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-parser

/**
   * Removes the duplicate YANG augment from the data tree by detaching it
   * from its parent and from its sibling.
   *
   * @param augment duplicate YANG augment
   */
  public static void removeAugment(YangAugment augment) {
    YangNode root = augment.getParent();
    YangNode child = root.getChild();
    YangNode pSib = null;
    if (child == null) {
      throw new ParserException("The root node of augment " + augment
          .getName() + " must have atleast one child");
    }
    while (child != null) {
      if (child == augment) {
        if (pSib == null) {
          root.setChild(null);
        } else {
          pSib.setNextSibling(null);
        }
      }
      pSib = child;
      child = child.getNextSibling();
    }
    augment = new YangJavaAugmentTranslator();
    augment = null;
  }
}

代码示例来源:origin: org.onosproject/onos-yang-compiler-datamodel

setChild(newChild);
} else {

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com