java.lang.Object
net.i2p.router.tunnel.pool.ExcluderBase
- Direct Known Subclasses:
ClientPeerSelector.IBGWExcluder, ClientPeerSelector.OBEPExcluder, TunnelPeerSelector.ClosestHopExcluder, TunnelPeerSelector.Excluder
A Set of Hashes that automatically adds to the Set in the
contains(Object) check.So we don't need to generate the exclude set up front. Less object churn and copying.
Field Summary
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExcluderBase(Set<Hash> set) Automatically check if peer is connected and add the Hash to the set if not.Method Summary
Modifier and TypeMethodDescriptionbooleanAdd the hash to the underlying set.booleanaddAll(Collection<? extends Hash> c) Add all of the hashes to the underlying set.voidclear()Remove all hashes from the underlying set.abstract booleanAutomatically check if peer is allowed and add the Hash to the set if not.booleancontainsAll(Collection<?> c) Whether the underlying set contains all of the given hashes.booleanWhether the underlying set equals the given object.protected StringFormat exclusion summary grouped by reason (counts only, no peer hashes).inthashCode()The hash code of the underlying set.booleanisEmpty()Whether the underlying set is empty.iterator()An iterator over the underlying set.protected voidrecordExclusion(Hash h, String reason) Record why a peer was excluded, for diagnostic logging.booleanRemove the hash from the underlying set.booleanremoveAll(Collection<?> c) Remove all of the given hashes from the underlying set.booleanretainAll(Collection<?> c) Retain only the given hashes in the underlying set.intsize()The number of hashes in the underlying set.Object[]toArray()The hashes of the underlying set as an array.<Hash> Hash[]toArray(Hash[] a) The hashes of the underlying set in the given array.toString()Description of the excluded set and its size.Methods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface Set
spliterator
Field Details
s
_reasons
Maps peer hash to the reason it was excluded, for diagnostic logging. Populated by subclasses viarecordExclusion(Hash, String).
Constructor Details
ExcluderBase
Method Details
contains
Automatically check if peer is allowed and add the Hash to the set if not.add
addAll
Add all of the hashes to the underlying set.clear
containsAll
Whether the underlying set contains all of the given hashes.- Specified by:
containsAllin interfaceCollection<Hash>- Specified by:
containsAllin interfaceSet<Hash>
equals
hashCode
isEmpty
iterator
remove
removeAll
Remove all of the given hashes from the underlying set.retainAll
Retain only the given hashes in the underlying set.size
toArray
toArray
recordExclusion
getReasonsSummary
toString