org.commonmark.node.Node.unlink()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(3.7k)|赞(0)|评价(0)|浏览(187)

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

Node.unlink介绍

暂无

代码示例

代码示例来源:origin: atlassian/commonmark-java

  1. public void insertAfter(Node sibling) {
  2. sibling.unlink();
  3. sibling.next = this.next;
  4. if (sibling.next != null) {
  5. sibling.next.prev = sibling;
  6. }
  7. sibling.prev = this;
  8. this.next = sibling;
  9. sibling.parent = this.parent;
  10. if (sibling.next == null) {
  11. sibling.parent.lastChild = sibling;
  12. }
  13. }

代码示例来源:origin: atlassian/commonmark-java

  1. public void insertBefore(Node sibling) {
  2. sibling.unlink();
  3. sibling.prev = this.prev;
  4. if (sibling.prev != null) {
  5. sibling.prev.next = sibling;
  6. }
  7. sibling.next = this;
  8. this.prev = sibling;
  9. sibling.parent = this.parent;
  10. if (sibling.prev == null) {
  11. sibling.parent.firstChild = sibling;
  12. }
  13. }

代码示例来源:origin: atlassian/commonmark-java

  1. public void appendChild(Node child) {
  2. child.unlink();
  3. child.setParent(this);
  4. if (this.lastChild != null) {
  5. this.lastChild.next = child;
  6. child.prev = this.lastChild;
  7. this.lastChild = child;
  8. } else {
  9. this.firstChild = child;
  10. this.lastChild = child;
  11. }
  12. }

代码示例来源:origin: atlassian/commonmark-java

  1. public void prependChild(Node child) {
  2. child.unlink();
  3. child.setParent(this);
  4. if (this.firstChild != null) {
  5. this.firstChild.prev = child;
  6. child.next = this.firstChild;
  7. this.firstChild = child;
  8. } else {
  9. this.firstChild = child;
  10. this.lastChild = child;
  11. }
  12. }

代码示例来源:origin: atlassian/commonmark-java

  1. private void mergeIfNeeded(Text first, Text last, int textLength) {
  2. if (first != null && last != null && first != last) {
  3. StringBuilder sb = new StringBuilder(textLength);
  4. sb.append(first.getLiteral());
  5. Node node = first.getNext();
  6. Node stop = last.getNext();
  7. while (node != stop) {
  8. sb.append(((Text) node).getLiteral());
  9. Node unlink = node;
  10. node = node.getNext();
  11. unlink.unlink();
  12. }
  13. String literal = sb.toString();
  14. first.setLiteral(literal);
  15. }
  16. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. public void insertAfter(Node sibling) {
  2. sibling.unlink();
  3. sibling.next = this.next;
  4. if (sibling.next != null) {
  5. sibling.next.prev = sibling;
  6. }
  7. sibling.prev = this;
  8. this.next = sibling;
  9. sibling.parent = this.parent;
  10. if (sibling.next == null) {
  11. sibling.parent.lastChild = sibling;
  12. }
  13. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. public void insertBefore(Node sibling) {
  2. sibling.unlink();
  3. sibling.prev = this.prev;
  4. if (sibling.prev != null) {
  5. sibling.prev.next = sibling;
  6. }
  7. sibling.next = this;
  8. this.prev = sibling;
  9. sibling.parent = this.parent;
  10. if (sibling.prev == null) {
  11. sibling.parent.firstChild = sibling;
  12. }
  13. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. public void appendChild(Node child) {
  2. child.unlink();
  3. child.setParent(this);
  4. if (this.lastChild != null) {
  5. this.lastChild.next = child;
  6. child.prev = this.lastChild;
  7. this.lastChild = child;
  8. } else {
  9. this.firstChild = child;
  10. this.lastChild = child;
  11. }
  12. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. public void prependChild(Node child) {
  2. child.unlink();
  3. child.setParent(this);
  4. if (this.firstChild != null) {
  5. this.firstChild.prev = child;
  6. child.next = this.firstChild;
  7. this.firstChild = child;
  8. } else {
  9. this.firstChild = child;
  10. this.lastChild = child;
  11. }
  12. }

代码示例来源:origin: org.symphonyoss.symphony/messageml

  1. @Override
  2. public void process(Text opener, Text closer, int delimiterUse) {
  3. Node node = opener.getNext();
  4. if (node instanceof Text) {
  5. Node result = createNode((Text) node);
  6. if (result != null) {
  7. opener.insertAfter(result);
  8. node.unlink();
  9. }
  10. }
  11. }
  12. }

代码示例来源:origin: com.atlassian.commonmark/commonmark

  1. private void mergeIfNeeded(Text first, Text last, int textLength) {
  2. if (first != null && last != null && first != last) {
  3. StringBuilder sb = new StringBuilder(textLength);
  4. sb.append(first.getLiteral());
  5. Node node = first.getNext();
  6. Node stop = last.getNext();
  7. while (node != stop) {
  8. sb.append(((Text) node).getLiteral());
  9. Node unlink = node;
  10. node = node.getNext();
  11. unlink.unlink();
  12. }
  13. String literal = sb.toString();
  14. first.setLiteral(literal);
  15. }
  16. }

代码示例来源:origin: noties/Markwon

  1. );
  2. iconGroupNode.appendChild(iconNode);
  3. next.unlink();
  4. handled = true;

相关文章