java.lang.Object
net.i2p.router.tunnel.pool.ExcluderBase
net.i2p.router.tunnel.pool.ClientPeerSelector.OBEPExcluder
All Implemented Interfaces:
Iterable<Hash>, Collection<Hash>, Set<Hash>
Enclosing class:
ClientPeerSelector

private class ClientPeerSelector.OBEPExcluderextends ExcluderBase
A Set of Hashes that automatically adds to the Set in the contains() check.

So we don't need to generate the exclude set up front.

  • Field Details

  • Constructor Details

    • OBEPExcluder

      public OBEPExcluder(Set<Hash> set)
      Automatically check if peer is connected and add the Hash to the set if not.
      Parameters:
      set - not copied, contents will be modified by all methods
  • Method Details

    • contains

      public boolean contains(Object o)
      Automatically check if peer is connected and add the Hash to the set if not. Passing peers are cached in _allowed so subsequent contains() calls for the same Hash skip the global cache lookup.
      Specified by:
      contains in interface Collection<Hash>
      Specified by:
      contains in interface Set<Hash>
      Specified by:
      contains in class ExcluderBase
      Parameters:
      o - the candidate peer hash, as passed by Set.contains(Object)
      Returns:
      true if peer should be excluded