The Encog Project

org.encog.bot.browse.extract
Class BasicExtract

java.lang.Object
  extended by org.encog.bot.browse.extract.BasicExtract
All Implemented Interfaces:
Extract
Direct Known Subclasses:
ExtractWords

public abstract class BasicExtract
extends java.lang.Object
implements Extract

Implements the basic functionality that most extractors will need to implement. Mostly this involves maintaining a collection of the extraction listeners that will receive events as the extraction occurs.

Author:
jheaton

Constructor Summary
BasicExtract()
           
 
Method Summary
 void addListener(ExtractListener listener)
          Add a listener for the extraction.
 void distribute(java.lang.Object object)
          Distribute an object to the listeners.
 java.util.List<java.lang.Object> extractList(WebPage page)
          Extract from the web page and return the results as a list.
 java.util.Collection<ExtractListener> getListeners()
           
 void removeListener(ExtractListener listener)
          Remove the specified listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.encog.bot.browse.extract.Extract
extract
 

Constructor Detail

BasicExtract

public BasicExtract()
Method Detail

addListener

public void addListener(ExtractListener listener)
Add a listener for the extraction.

Specified by:
addListener in interface Extract
Parameters:
listener - The listener to add.

distribute

public void distribute(java.lang.Object object)
Distribute an object to the listeners.

Parameters:
object - The object to be distributed.

extractList

public java.util.List<java.lang.Object> extractList(WebPage page)
Extract from the web page and return the results as a list.

Specified by:
extractList in interface Extract
Parameters:
page - The web page to extract from.
Returns:
The results of the extraction as a List.

getListeners

public java.util.Collection<ExtractListener> getListeners()
Specified by:
getListeners in interface Extract
Returns:
A list of listeners registered with this object.

removeListener

public void removeListener(ExtractListener listener)
Remove the specified listener.

Specified by:
removeListener in interface Extract
Parameters:
listener - The listener to rmove.

The Encog Project