ElementNode extends AbstractStructForwardingNode implements NameNode, ImmutableXmlNode { public ElementNode(final BigInteger hashCode, final StructNodeDelegate structDel, final NameNodeDelegate nameDel, final List<Long> attributeKeys, final BiMap<Long, Long> attributes, final List<Long> namespaceKeys, final QNm qNm) { mHash = hashCode; assert structDel != null; structNodeDel = structDel; assert nameDel != null; mNameDel = nameDel; assert attributeKeys != null; mAttributeKeys = attributeKeys; assert attributes != null; mAttributes = attributes; assert namespaceKeys != null; mNamespaceKeys = namespaceKeys; assert qNm != null; mQNm = qNm; } ElementNode(final BigInteger hashCode, final StructNodeDelegate structDel, final NameNodeDelegate nameDel, final List<Long> attributeKeys,
      final BiMap<Long, Long> attributes, final List<Long> namespaceKeys, final QNm qNm);  ElementNode(final StructNodeDelegate structDel, final NameNodeDelegate nameDel, final List<Long> attributeKeys,
      final BiMap<Long, Long> attributes, final List<Long> namespaceKeys, final QNm qNm); int getAttributeCount(); long getAttributeKey(final @Nonnegative int index); Optional<Long> getAttributeKeyByName(final QNm name); Optional<Long> getAttributeNameKey(final @Nonnegative long key); void insertAttribute(final @Nonnegative long attrKey, final long nameIndex); void removeAttribute(final @Nonnegative long attrKey); int getNamespaceCount(); long getNamespaceKey(final @Nonnegative int namespaceKey); void insertNamespace(final long namespaceKey); void removeNamespace(final long namespaceKey); @Override int getPrefixKey(); @Override int getLocalNameKey(); @Override int getURIKey(); @Override void setPrefixKey(final int prefixKey); @Override void setLocalNameKey(final int localNameKey); @Override void setURIKey(final int uriKey); @Override NodeKind getKind(); @Override String toString(); @Override VisitResult acceptVisitor(final XmlNodeVisitor visitor); @Override BigInteger computeHash(); @Override void setHash(final BigInteger hash); @Override BigInteger getHash(); @Override int hashCode(); @Override boolean equals(final Object obj); List<Long> getAttributeKeys(); List<Long> getNamespaceKeys(); @Nonnull NameNodeDelegate getNameNodeDelegate(); @Override void setPathNodeKey(final @Nonnegative long pathNodeKey); @Override long getPathNodeKey(); @Override QNm getName(); @Override SirixDeweyID getDeweyID(); @Override int getTypeKey();  }
@Test public void testElementNode() throws IOException { final NodeDelegate del = new NodeDelegate(13, 14, Hashing.sha256(), null, 0, SirixDeweyID.newRootID()); final StructNodeDelegate strucDel = new StructNodeDelegate(del, 12l, 17l, 16l, 1l, 0); final NameNodeDelegate nameDel = new NameNodeDelegate(del, 17, 18, 19, 1); final ElementNode node = new ElementNode(strucDel, nameDel, new ArrayList<>(), HashBiMap.create(), new ArrayList<>(), new QNm("ns", "a", "p")); node.setHash(node.computeHash()); node.insertAttribute(97, 100); node.insertAttribute(98, 101); node.insertNamespace(99); node.insertNamespace(100); check(node); final ByteArrayOutputStream out = new ByteArrayOutputStream(); node.getKind().serialize(new DataOutputStream(out), node, mPageReadTrx); final ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); final ElementNode node2 = (ElementNode) NodeKind.ELEMENT.deserialize(new DataInputStream(in), node.getNodeKey(), node.getDeweyID(), mPageReadTrx); check(node2); }