gpt4 book ai didi

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

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

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

YangNode.setNextSibling介绍

[英]Sets the next sibling of 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

/**
 * 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-datamodel

clonedNode.setNextSibling(null);
clonedNode.setPreviousSibling(null);
if (!isDeviation) {

代码示例来源: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-linker

node.setNextSibling(null);
node.setPreviousSibling(null);
node.setParent(null);
node.setNextSibling(null);
node.setPreviousSibling(null);
node.setParent(null);

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

augChild.setParent(lastChild.getParent());
augChild.setPreviousSibling(lastChild);
lastChild.setNextSibling(augChild);

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

setNextSibling(newSibling);
} else {
  throw new DataModelException("New sibling to be added is not " +

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

curNode.setNextSibling(newChild);
newChild.setPreviousSibling(curNode);

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