Package net.i2p.router.tunnel.pool
Class ExcluderBase
- java.lang.Object
-
- net.i2p.router.tunnel.pool.ExcluderBase
-
- Direct Known Subclasses:
TunnelPeerSelector.Excluder
abstract class ExcluderBase extends Object implements Set<Hash>
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. Less object churn and copying.- Since:
- 0.9.58
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExcluderBase(Set<Hash> set)
Automatically check if peer is connected and add the Hash to the set if not.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
add(Hash h)
boolean
addAll(Collection<? extends Hash> c)
void
clear()
abstract boolean
contains(Object o)
Automatically check if peer is allowed and add the Hash to the set if not.boolean
containsAll(Collection<?> c)
boolean
equals(Object o)
int
hashCode()
boolean
isEmpty()
Iterator<Hash>
iterator()
boolean
remove(Object o)
boolean
removeAll(Collection<?> c)
boolean
retainAll(Collection<?> c)
int
size()
Object[]
toArray()
<Hash> Hash[]
toArray(Hash[] a)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface java.util.Set
spliterator
-
-
-
-
Method Detail
-
contains
public abstract boolean contains(Object o)
Automatically check if peer is allowed and add the Hash to the set if not.
-
add
public boolean add(Hash h)
-
addAll
public boolean addAll(Collection<? extends Hash> c)
-
clear
public void clear()
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAll
in interfaceCollection<Hash>
- Specified by:
containsAll
in interfaceSet<Hash>
-
equals
public boolean equals(Object o)
-
hashCode
public int hashCode()
-
isEmpty
public boolean isEmpty()
-
remove
public boolean remove(Object o)
-
removeAll
public boolean removeAll(Collection<?> c)
-
retainAll
public boolean retainAll(Collection<?> c)
-
size
public int size()
-
toArray
public Object[] toArray()
-
toArray
public <Hash> Hash[] toArray(Hash[] a)
-
-