public int getNodesCount(NodeType type) { return counts[type.ordinal()]; }
@Override public String toString() { return getType().name(); }
private void count(Node node) { counts[node.getType().ordinal()]++; if (node instanceof Element) { atts += ((Element) node).getAttributesCount(); } if (node instanceof Parent) { for (final Node child : ((Parent) node).getChildren()) { count(child); } } } }