Transforms a {@link ClassNode} into a {@link Node} of {@link OWLClass}es.

@param n may be null, in which case an empty Node is returned
@return
480488
private Node<OWLClass> nodeToOwlClassNode(au.csiro.ontology.Node n) {
        if(n == null) return new OWLClassNode();

        final Set<OWLClass> classes = new HashSet<>();

        for (Object eq : n.getEquivalentConcepts()) {
            classes.add(getOWLClass(eq));
        }

        return new OWLClassNode(classes);
    }
943621
NodeAVL getNextNode(NodeAVL n) {

        if (n == null) {
            n = nPrimaryNode;
        } else {
            n = n.nNext;
        }

        return n;
    }
1346368
private Class nodeClass(XmlParser.Node node) throws ClassNotFoundException
    {
        String className = node.getAttribute("class");
        if (className == null) return null;

        return Loader.loadClass(XmlConfiguration.class, className);
    }
1023304
public static String getMergedNestedText(Node n) {
        StringBuilder sb = new StringBuilder();
        for (Node child : new IterableNodeList(n.getChildNodes())) {
            if (child instanceof Text || child instanceof CDATASection) {
                String s = child.getNodeValue();
                if (s != null) {
                    sb.append(s);
                }
            }
        }
        return sb.toString();
    }
1308229
private Node getParent(Node n) {
        if (n.y_s == null) {
            return null;
        }
        Node c = n.y_s;
        if (c.o_c == n) {
            return c;
        }
        Node p1 = c.y_s;
        if (p1 != null && p1.o_c == n) {
            return p1;
        }
        return c;
    }
292017
public Node getNode(final int i) {
        if (i < 0 || i >= nodeList.size()) {
            return null;
        }
        return nodeList.get(i);
    }
1092887
public ClassNode parent(String name) {
        this.parent = infoBase.node(name);
        this.parent.addChild(this);
        for (ClassNode intf : parent.interfaces.values()) {
            addInterface(intf);
        }
        return this;
    }
779479
public static Document getOwnerDocument(Node n) {
    return n == null || !isElement(n) ? null : n.getNodeType() == Node.DOCUMENT_NODE
        ? n.<Document> cast() : n.getOwnerDocument();
  }
985389
private Node<K, V> cutChildren(Node<K, V> n) {
        Node<K, V> child = n.o_c;
        n.o_c = null;
        if (child != null) {
            child.o_s = null;
        }
        return child;
    }
808374
private void normalizeNodeTypes(Node n) {
    normalizeBlocks(n);

    for (Node child = n.getFirstChild();
         child != null; child = child.getNext()) {
      // This pass is run during the CompilerTestCase validation, so this
      // parent pointer check serves as a more general check.
      checkState(child.getParent() == n);

      normalizeNodeTypes(child);
    }
  }
287018
public String cardinal(Long n) {
        return (n == null) ? null : cardinal(n.longValue());
    }
572422
private ClassDescriptor getNullnessAnnotationClassDescriptor(NullnessAnnotation n) {
        if (n == NullnessAnnotation.CHECK_FOR_NULL) {
            return JSR305NullnessAnnotations.CHECK_FOR_NULL;
        } else if (n == NullnessAnnotation.NONNULL) {
            return JSR305NullnessAnnotations.NONNULL;
        } else if (n == NullnessAnnotation.NULLABLE) {
            return JSR305NullnessAnnotations.NULLABLE;
        } else if (n == NullnessAnnotation.UNKNOWN_NULLNESS) {
            return JSR305NullnessAnnotations.NULLABLE;
        } else {
            throw new IllegalArgumentException("Unknown NullnessAnnotation: " + n);
        }
    }
607482
public static QName fromNode(final Node nd) {
    String ns = nd.getNamespaceURI();

    if (ns == null) {
      /* It appears a node can have a NULL namespace but a QName has a zero length
       */
      ns = "";
    }

    return new QName(ns, nd.getLocalName());
  }
846781
protected void appendNode(Node n)
    {
        if (mRootNode != null) {
            mRootNode.appendChild(n);
        } else {
            mElement.appendChild(n);
        }
    }
99477
private Node tryFoldLiteralConstructor(Node n) {
    checkArgument(n.isCall() || n.isNew());

    Node constructorNameNode = n.getFirstChild();

    Node newLiteralNode = null;

    // We require the AST to be normalized to ensure that, say,
    // Object() really refers to the built-in Object constructor
    // and not a user-defined constructor with the same name.

    if (isASTNormalized() && constructorNameNode.isName()) {

      String className = constructorNameNode.getString();

      if ("RegExp".equals(className)) {
        // "RegExp("boo", "g")" --> /boo/g
        return tryFoldRegularExpressionConstructor(n);
      } else {
        boolean constructorHasArgs = constructorNameNode.getNext() != null;

        if ("Object".equals(className) && !constructorHasArgs) {
          // "Object()" --> "{}"
          newLiteralNode = IR.objectlit();
        } else if ("Array".equals(className)) {
          // "Array(arg0, arg1, ...)" --> "[arg0, arg1, ...]"
          Node arg0 = constructorNameNode.getNext();
          FoldArrayAction action = isSafeToFoldArrayConstructor(arg0);

          if (action == FoldArrayAction.SAFE_TO_FOLD_WITH_ARGS ||
              action == FoldArrayAction.SAFE_TO_FOLD_WITHOUT_ARGS) {
            newLiteralNode = IR.arraylit();
            n.removeFirstChild(); // discard the function name
            Node elements = n.removeChildren();
            if (action == FoldArrayAction.SAFE_TO_FOLD_WITH_ARGS) {
              newLiteralNode.addChildrenToFront(elements);
            }
          }
        }

        if (newLiteralNode != null) {
          n.replaceWith(newLiteralNode);
          reportChangeToEnclosingScope(newLiteralNode);
          return newLiteralNode;
        }
      }
    }
    return n;
  }
486757
public static AnnotationNode addAnnotationOrGetExisting(ClassNode classNode, Class<? extends Annotation> annotationClass) {
        return addAnnotationOrGetExisting(classNode, annotationClass, Collections.<String, Object>emptyMap());
    }
1175412
private Object fromNode(final ImmutableNode node) {
        if (!node.getChildren().isEmpty()) {
            final Map<String, List<ImmutableNode>> children = getChildrenWithName(node);

            final HashMap<String, Object> map = new HashMap<>();
            for (final Map.Entry<String, List<ImmutableNode>> entry : children.entrySet()) {
                assert !entry.getValue().isEmpty();
                if (entry.getValue().size() == 1) {
                    // Just one node.
                    final ImmutableNode child = entry.getValue().get(0);
                    final Object childValue = fromNode(child);
                    map.put(entry.getKey(), childValue);
                } else {
                    // Multiple nodes.
                    final ArrayList<Object> list = new ArrayList<>();
                    for (final ImmutableNode child : entry.getValue()) {
                        final Object childValue = fromNode(child);
                        list.add(childValue);
                    }
                    map.put(entry.getKey(), list);
                }
            }
            return map;
        } else {
            return node.getValue();
        }
    }