net.i2p.router.tunnel.pool

## Class TunnelPeerSelector.Excluder

- java.lang.Object
- - net.i2p.router.tunnel.pool.ExcluderBase
  - - net.i2p.router.tunnel.pool.TunnelPeerSelector.Excluder

- All Implemented Interfaces:
    Iterable<Hash>, Collection<Hash>, Set<Hash>
  Enclosing class:
    TunnelPeerSelector

      protected class TunnelPeerSelector.Excluder
      extends ExcluderBase

  Excluder that automatically adds peers to the set when they should be excluded.

- - ### Field Summary

    - ### Fields inherited from class net.i2p.router.tunnel.pool.ExcluderBase

      `s`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Excluder(boolean isInbound, boolean isExploratory)` Automatically adds selectPeersInTooManyTunnels(), unless i2np.allowLocal.
    `Excluder(boolean isInbound, boolean isExploratory, Set<Hash> toAdd)` Does not add selectPeersInTooManyTunnels().

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `contains(Object o)` Check if a peer should be excluded.

    - ### Methods inherited from class net.i2p.router.tunnel.pool.ExcluderBase

      `add, addAll, clear, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString`

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

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface java.util.Set

      `spliterator`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, removeIf, stream`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach`

- - ### Constructor Detail

    - #### Excluder

          public Excluder(boolean isInbound,
                          boolean isExploratory)

      Automatically adds selectPeersInTooManyTunnels(), unless i2np.allowLocal.

    - #### Excluder

          public Excluder(boolean isInbound,
                          boolean isExploratory,
                          Set<Hash> toAdd)

      Does not add selectPeersInTooManyTunnels(). Makes a copy of toAdd
      Parameters:
        `toAdd` - initial contents, copied

  - ### Method Detail

    - #### contains

          public boolean contains(Object o)

      Check if a peer should be excluded. Automatically adds to the set if excluded.
      Specified by:
        `contains` in interface `Collection<Hash>`
      Specified by:
        `contains` in interface `Set<Hash>`
      Specified by:
        `contains` in class `ExcluderBase`
      Parameters:
        `o` - a Hash object to check
      Returns:
        true if peer should be excluded (and added to set)