public class CandidateHarvesterSet extends AbstractSet<CandidateHarvester>
Set
of CandidateHarvesters which runs the
gathering of candidate addresses performed by its elements in parallel.Modifier and Type | Field and Description |
---|---|
private Collection<CandidateHarvesterSetElement> |
elements
The CandidateHarvesters which are the elements of this
Set.
|
private static Logger |
logger
The Logger used by the Agent class and its instances
for logging output.
|
private static ExecutorService |
threadPool
A pool of thread used for gathering process.
|
Constructor and Description |
---|
CandidateHarvesterSet()
Initializes a new CandidateHarvesterSet instance.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(CandidateHarvester harvester)
Adds a specific CandidateHarvester to this
CandidateHarvesterSet and returns true if it is not
already present.
|
void |
harvest(Component component)
Gathers candidate addresses for a specific Component.
|
private void |
harvest(Iterator<CandidateHarvesterSetElement> harvesters,
List<Component> components,
ExecutorService executorService,
TrickleCallback trickleCallback)
Gathers candidate addresses for a specific Component using
specific CandidateHarvesters.
|
void |
harvest(List<Component> components,
TrickleCallback trickleCallback)
Gathers candidate addresses for a specific Component.
|
Iterator<CandidateHarvester> |
iterator()
Returns an Iterator over the CandidateHarvesters which
are elements in this CandidateHarvesterSet.
|
int |
size()
Returns the number of CandidateHarvesters which are elements in
this CandidateHarvesterSet.
|
equals, hashCode, removeAll
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, clear, contains, containsAll, isEmpty, remove, retainAll, spliterator, toArray, toArray
parallelStream, removeIf, stream
private static final Logger logger
private final Collection<CandidateHarvesterSetElement> elements
private static ExecutorService threadPool
public CandidateHarvesterSet()
public boolean add(CandidateHarvester harvester)
add
in interface Collection<CandidateHarvester>
add
in interface Set<CandidateHarvester>
add
in class AbstractCollection<CandidateHarvester>
harvester
- the CandidateHarvester to be added to this
CandidateHarvesterSetSet.add(Object)
public void harvest(Component component)
component
- the Component to gather candidate addresses forCandidateHarvester.harvest(Component)
public void harvest(List<Component> components, TrickleCallback trickleCallback)
components
- the Component to gather candidate addresses fortrickleCallback
- the TrickleCallback
that we will be
feeding candidates to, or null in case the application doesn't
want us trickling any candidatesCandidateHarvester.harvest(Component)
private void harvest(Iterator<CandidateHarvesterSetElement> harvesters, List<Component> components, ExecutorService executorService, TrickleCallback trickleCallback)
harvesters
- the CandidateHarvesters to gather candidate
addresses for the specified Componentcomponents
- the Components to gather candidate addresses
for.executorService
- the ExecutorService to schedule the
execution of the gathering of candidate addresses performed by the
specified harvesterstrickleCallback
- the TrickleCallback
that we will be
feeding candidates to, or null in case the application doesn't
want us trickling any candidatespublic Iterator<CandidateHarvester> iterator()
iterator
in interface Iterable<CandidateHarvester>
iterator
in interface Collection<CandidateHarvester>
iterator
in interface Set<CandidateHarvester>
iterator
in class AbstractCollection<CandidateHarvester>
Set.iterator()
public int size()
size
in interface Collection<CandidateHarvester>
size
in interface Set<CandidateHarvester>
size
in class AbstractCollection<CandidateHarvester>
Set.size()
Copyright © 2018. All rights reserved.