org.klomp.snark.dht

## Class DHTNodes

- java.lang.Object
- - org.klomp.snark.dht.DHTNodes

-     class DHTNodes
      extends Object

  All the nodes we know about, stored as a mapping from node ID to a Destination and Port.

  And a real Kademlia routing table, which stores node IDs only.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DHTNodes(I2PAppContext ctx, NID me)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()`
    `List<NodeInfo>` | `findClosest(SHA1Hash h, int numWant)` DHT
    `NodeInfo` | `get(NID nid)`
    `List<NID>` | `getExploreKeys()` DHT - get random keys to explore
    `NodeInfo` | `putIfAbsent(NodeInfo nInfo)`
    `NodeInfo` | `remove(NID nid)`
    `void` | `renderStatusHTML(StringBuilder buf)` Debug info, HTML formatted
    `int` | `size()`
    `void` | `start()`
    `void` | `stop()`
    `Collection<NodeInfo>` | `values()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DHTNodes

          public DHTNodes(I2PAppContext ctx,
                          NID me)

  - ### Method Detail

    - #### clear

          public void clear()

    - #### findClosest

          public List<NodeInfo> findClosest(SHA1Hash h,
                                            int numWant)

      DHT
      Parameters:
        `h` - either a InfoHash or a NID

    - #### get

          public NodeInfo get(NID nid)

    - #### getExploreKeys

          public List<NID> getExploreKeys()

      DHT - get random keys to explore

    - #### putIfAbsent

          public NodeInfo putIfAbsent(NodeInfo nInfo)

      Returns:
        the old value if present, else null

    - #### remove

          public NodeInfo remove(NID nid)

    - #### renderStatusHTML

          public void renderStatusHTML(StringBuilder buf)

      Debug info, HTML formatted

    - #### size

          public int size()

      Returns:
        known nodes, not total net size

    - #### start

          public void start()

    - #### stop

          public void stop()

    - #### values

          public Collection<NodeInfo> values()