class PeerCoordinatorSet extends Object implements Iterable<PeerCoordinator>
This class provides a centralized registry for PeerCoordinator objects, enabling the multi-torrent functionality in I2PSnark. It is primarily used by:
The set maps torrent info hashes to their corresponding PeerCoordinator instances, allowing efficient lookup by torrent identifier. All operations are thread-safe through ConcurrentHashMap.
Each PeerCoordinator is automatically added when a torrent starts and removed when the torrent stops, ensuring the set always reflects currently active torrents.
| Constructor and Description |
|---|
PeerCoordinatorSet() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(PeerCoordinator coordinator) |
PeerCoordinator |
get(byte[] infoHash) |
Iterator<PeerCoordinator> |
iterator() |
void |
remove(PeerCoordinator coordinator) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic void add(PeerCoordinator coordinator)
public PeerCoordinator get(byte[] infoHash)
public Iterator<PeerCoordinator> iterator()
iterator in interface Iterable<PeerCoordinator>public void remove(PeerCoordinator coordinator)