MCPcopy Create free account
hub / github.com/GateNLP/gate-core / writeObject

Method writeObject

src/main/java/gate/util/RBTreeMap.java:1527–1542  ·  view source on GitHub ↗

Save the state of the RBTreeMap instance to a stream (i.e., serialize it). @serialData The size of the RBTreeMap (the number of key-value mappings) is emitted (int), followed by the key (Object) and value (Object) for each key-value mapping represented by the RBTreeMap.

(java.io.ObjectOutputStream s)

Source from the content-addressed store, hash-verified

1525 * Comparator).
1526 */
1527 private void writeObject(java.io.ObjectOutputStream s)
1528 throws java.io.IOException {
1529
1530 // Write out the Comparator and any hidden stuff
1531 s.defaultWriteObject();
1532
1533 // Write out size (number of Mappings)
1534 s.writeInt(size);
1535
1536 // Write out keys and values (alternating)
1537 for (java.util.Iterator<Map.Entry<K,V>> i = entrySet().iterator(); i.hasNext(); ) {
1538 Map.Entry<K,V> e = i.next();
1539 s.writeObject(e.getKey());
1540 s.writeObject(e.getValue());
1541 }
1542 } // writeObject
1543
1544
1545

Callers 4

writeOnDiskMethod · 0.45
syncMethod · 0.45
runMethod · 0.45
saveObjectToFileMethod · 0.45

Calls 7

entrySetMethod · 0.95
writeIntMethod · 0.80
iteratorMethod · 0.65
hasNextMethod · 0.65
nextMethod · 0.65
getKeyMethod · 0.65
getValueMethod · 0.65

Tested by

no test coverage detected