org.encog.bot.browse
Class WebPage
- java.lang.Object
-
- org.encog.bot.browse.WebPage
-
public class WebPage extends java.lang.ObjectHolds a web page that was loaded by the Browse class. Web pages are made up of DataUnits and contents, which are ranges of data units. The data units are basically tags and blocks of text. The contents collection uses DocumentRange objects to assign meatning to the lower level DataObjects.
-
-
Constructor Summary
Constructors Constructor and Description WebPage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddContent(DocumentRange span)Add to the content collection.voidaddDataUnit(DataUnit unit)Add a data unit to the collection.DocumentRangefind(java.lang.Class<?> c, int index)Find the specified DocumentRange subclass in the contents list.LinkfindLink(java.lang.String str)Find the link that contains the specified string.java.util.List<DocumentRange>getContents()java.util.List<DataUnit>getData()intgetDataSize()Get the number of data items in this collection.DataUnitgetDataUnit(int i)Get the DataUnit unit at the specified index.DocumentRangegetTitle()Get the title for this document.voidsetTitle(DocumentRange theTitle)Set the title of this document.java.lang.StringtoString()
-
-
-
Method Detail
-
addContent
public final void addContent(DocumentRange span)
Add to the content collection.- Parameters:
span- The range to add to the collection.
-
addDataUnit
public final void addDataUnit(DataUnit unit)
Add a data unit to the collection.- Parameters:
unit- The data unit to load.
-
find
public final DocumentRange find(java.lang.Class<?> c, int index)
Find the specified DocumentRange subclass in the contents list.- Parameters:
c- The class type to search for.index- The index to search from.- Returns:
- The document range that was found.
-
findLink
public final Link findLink(java.lang.String str)
Find the link that contains the specified string.- Parameters:
str- The string to search for.- Returns:
- The link that contains the specified string.
-
getContents
public final java.util.List<DocumentRange> getContents()
- Returns:
- The contents in a list collection.
-
getData
public final java.util.List<DataUnit> getData()
- Returns:
- The data units in a list collection.
-
getDataSize
public final int getDataSize()
Get the number of data items in this collection.- Returns:
- The size of the data unit.
-
getDataUnit
public final DataUnit getDataUnit(int i)
Get the DataUnit unit at the specified index.- Parameters:
i- The index to use.- Returns:
- The DataUnit found at the specified index.
-
getTitle
public final DocumentRange getTitle()
Get the title for this document.- Returns:
- The DocumentRange that specifies the title of this document.
-
setTitle
public final void setTitle(DocumentRange theTitle)
Set the title of this document.- Parameters:
theTitle- The DocumentRange that specifies the title.
-
toString
public final java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG