AttributeNode extends AbstractForwardingNode implements ValueNode, NameNode, ImmutableXmlNode { public AttributeNode(final NodeDelegate nodeDel, final NameNodeDelegate nameDel, final ValueNodeDelegate valDel, final QNm qNm) { assert nodeDel != null : "nodeDel must not be null!"; mNodeDel = nodeDel; assert nameDel != null : "nameDel must not be null!"; mNameDel = nameDel; assert valDel != null : "valDel must not be null!"; mValDel = valDel; assert qNm != null : "qNm must not be null!"; mQNm = qNm; } AttributeNode(final NodeDelegate nodeDel, final NameNodeDelegate nameDel, final ValueNodeDelegate valDel,
      final QNm qNm);  AttributeNode(final BigInteger hashCode, final NodeDelegate nodeDel, final NameNodeDelegate nameDel,
      final ValueNodeDelegate valDel, final QNm qNm); @Override NodeKind getKind(); @Override BigInteger computeHash(); @Override void setHash(BigInteger hash); @Override BigInteger getHash(); @Override VisitResult acceptVisitor(final XmlNodeVisitor visitor); @Override String toString(); @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 byte[] getRawValue(); @Override void setValue(final byte[] value); @Override int hashCode(); @Override boolean equals(final @Nullable Object obj); @Override void setPathNodeKey(final @Nonnegative long pathNodeKey); @Override long getPathNodeKey(); NameNodeDelegate getNameNodeDelegate(); ValueNodeDelegate getValNodeDelegate(); @Override QNm getName(); @Override String getValue(); @Override SirixDeweyID getDeweyID(); @Override int getTypeKey();  }
@Test public void testAttributeNode() throws IOException { final byte[] value = {(byte) 17, (byte) 18}; final NodeDelegate del = new NodeDelegate(99, 13, Hashing.sha256(), null, 0, SirixDeweyID.newRootID()); final NameNodeDelegate nameDel = new NameNodeDelegate(del, 13, 14, 15, 1); final ValueNodeDelegate valDel = new ValueNodeDelegate(del, value, false); final AttributeNode node = new AttributeNode(del, nameDel, valDel, new QNm("ns", "a", "p")); node.setHash(node.computeHash()); check(node); final ByteArrayOutputStream out = new ByteArrayOutputStream(); node.getKind().serialize(new DataOutputStream(out), node, pageReadOnlyTrx); final ByteArrayInputStream in = new ByteArrayInputStream(out.toByteArray()); final AttributeNode node2 = (AttributeNode) NodeKind.ATTRIBUTE.deserialize(new DataInputStream(in), node.getNodeKey(), node.getDeweyID(), pageReadOnlyTrx); check(node2); }