MCPcopy Create free account
hub / github.com/BaseXdb/basex / write

Method write

basex-core/src/main/java/org/basex/index/path/PathNode.java:133–155  ·  view source on GitHub ↗

Finalizes the index and writes the node to the specified output stream. @param out output stream @param meta meta data @throws IOException I/O exception

(final DataOutput out, final MetaData meta)

Source from the content-addressed store, hash-verified

131 * @throws IOException I/O exception
132 */
133 void write(final DataOutput out, final MetaData meta) throws IOException {
134 out.writeNum(name);
135 out.write1(kind);
136 // legacy (required before version 7.1)
137 out.writeNum(0);
138 out.writeNum(children.length);
139 // legacy (required before version 7.1)
140 out.writeDouble(1);
141
142 // update leaf flag
143 boolean leaf = stats.isLeaf();
144 for(final PathNode child : children) {
145 if(child.kind == Data.TEXT) {
146 if(empty != 0) child.stats.add(Token.EMPTY, meta);
147 } else if(child.kind != Data.ATTR) {
148 leaf = false;
149 }
150 }
151
152 stats.setLeaf(leaf);
153 stats.write(out);
154 for(final PathNode child : children) child.write(out, meta);
155 }
156
157 /**
158 * Recursively adds the node and its descendants to the specified list.

Callers

nothing calls this directly

Calls 6

writeDoubleMethod · 0.80
setLeafMethod · 0.80
addMethod · 0.65
writeNumMethod · 0.45
write1Method · 0.45
isLeafMethod · 0.45

Tested by

no test coverage detected