improve javadoc
This commit is contained in:
@@ -21,11 +21,11 @@ import org.lucares.utils.byteencoder.VariableByteEncoder;
|
||||
* <pre>
|
||||
* Node layout:
|
||||
*
|
||||
* ◀─────── Prefix ──────▶ ◀───────────────── Suffix ──────────────────▶
|
||||
* ──────── Prefix ──────▶ ◀───────────────── Suffix ───────────────────
|
||||
* ┏━━━┳━━━━━┳━━━━━┳━━━━━┳━━━┳╸╺╸╺╸╺╸╺┳━━━━━━━━━━━┳━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┓
|
||||
* ┃ 6 ┃ 5,6 ┃ 3,6 ┃ 3,2 ┃ ∅ ┃ ┃"ba"->"147"┃"foobar"->"467"┃"foobaz"->"value"┃
|
||||
* ┗━━━┻━━━━━┻━━━━━┻━━━━━┻━━━┻╸╺╸╺╸╺╸╺┻━━━━━━━━━━━┻━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━┛
|
||||
* │ │ │ │ │ │ │ └▶ null byte that serves as a separator for the prefix.
|
||||
* │ │ │ │ │ │ │ └▶ null byte that serves as a terminator for the prefix.
|
||||
* │ │ │ │ │ │ └▶ size of the third last key ("ba" in this example)
|
||||
* │ │ │ │ │ └▶ size of the third last value ("147" in this example)
|
||||
* │ │ │ │ └▶ size of the second last key ("foobar" in this example)
|
||||
@@ -202,13 +202,13 @@ public class PersistentMapDiskNode {
|
||||
+ String.join("\n", entries.values().stream().map(NodeEntry::toString).collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
public <K, V> String toString(Function<byte[], K> keyDecoder, Function<byte[], V> valueDecoder) {
|
||||
StringBuilder result = new StringBuilder();
|
||||
public <K, V> String toString(final Function<byte[], K> keyDecoder, final Function<byte[], V> valueDecoder) {
|
||||
final StringBuilder result = new StringBuilder();
|
||||
result.append("@");
|
||||
result.append(nodeOffset);
|
||||
result.append(": ");
|
||||
for (NodeEntry e : entries.values()) {
|
||||
String s = e.toString(keyDecoder, valueDecoder);
|
||||
for (final NodeEntry e : entries.values()) {
|
||||
final String s = e.toString(keyDecoder, valueDecoder);
|
||||
result.append("\n");
|
||||
result.append(s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user