T - what is crawler crawlingpublic abstract class Crawler<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Set<T> |
cache
Set of all values found by this crawler.
|
protected Set<T> |
cacheUm
Unmodifiable wrapper of cache.
|
protected Set<CrawlerListener<T>> |
listeners
Set of listeners for crawler.
|
protected Set<CrawlerListener<T>> |
listenersUm
Unmodifiable wrapper of listeners.
|
| Constructor and Description |
|---|
Crawler() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(CrawlerListener<T> listener)
Add listener for crawler.
|
abstract void |
crawl()
Start crawling for the primitives.
|
abstract void |
die()
Terminate the crawler, once this is called, crawler should die and liseners shouldn't recieve
any further messages.
|
abstract String |
getDescription()
Get description of the primitive.
|
abstract String |
getName()
Get name of primitive this provider is crawling
|
protected void |
notifyCrawledData(Collection<T> data)
Notify all listeners that we have new data as result of diligent crawling.
|
protected void |
notifyFinished(boolean error)
Notify all listeners that crawling has been finished.
|
protected void |
notifyStarted()
Notify all listeners that crawling has started.
|
boolean |
removeListener(CrawlerListener<T> listener)
Remove crawler listener from set of listeners.
|
protected final Set<CrawlerListener<T>> listeners
unmodifiable version.protected final Set<CrawlerListener<T>> listenersUm
public abstract String getName()
public abstract String getDescription()
public abstract void crawl()
CrawlerListenerpublic abstract void die()
CrawlerListener#finished(boolean) .public final boolean addListener(CrawlerListener<T> listener)
listener - listener to addpublic final boolean removeListener(CrawlerListener<T> listener)
listener - listener to removeprotected final void notifyStarted()
protected final void notifyCrawledData(Collection<T> data)
protected final void notifyFinished(boolean error)
error - am I ending due to an error?Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.