org.encog.bot.browse.range
Class DocumentRange
- java.lang.Object
-
- org.encog.bot.browse.range.DocumentRange
-
- Direct Known Subclasses:
- Div, Form, FormElement, Link, Span
public class DocumentRange extends java.lang.ObjectBase class that represents a document range. A document range is a collection of tags that all apply to one "concept". For example, a Form, or a Link. This allows the form to collect the elements inside the form, or a link to collect the text along with the link tag.
-
-
Constructor Summary
Constructors Constructor and Description DocumentRange(WebPage theSource)Construct a document range from the specified WebPage.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddElement(DocumentRange element)Add an element.intgetBegin()java.lang.StringgetClassAttribute()java.util.List<DocumentRange>getElements()intgetEnd()java.lang.StringgetIdAttribute()DocumentRangegetParent()WebPagegetSource()java.lang.StringgetTextOnly()Get the text from this range.voidsetBegin(int theBegin)Set the beginning index.voidsetClassAttribute(java.lang.String theClassAttribute)voidsetEnd(int theEnd)Set the ending index.voidsetIdAttribute(java.lang.String id)voidsetParent(DocumentRange theParent)Set the parent.voidsetSource(WebPage theSource)Set the source web page.
-
-
-
Constructor Detail
-
DocumentRange
public DocumentRange(WebPage theSource)
Construct a document range from the specified WebPage.- Parameters:
theSource- The web page that this range belongs to.
-
-
Method Detail
-
addElement
public final void addElement(DocumentRange element)
Add an element.- Parameters:
element- The element to add.
-
getBegin
public final int getBegin()
- Returns:
- The beginning index.
-
getClassAttribute
public final java.lang.String getClassAttribute()
- Returns:
- the classAttribute
-
getElements
public final java.util.List<DocumentRange> getElements()
- Returns:
- The elements of this document range.
-
getEnd
public final int getEnd()
- Returns:
- The ending index.
-
getIdAttribute
public final java.lang.String getIdAttribute()
- Returns:
- the idAttribute
-
getParent
public final DocumentRange getParent()
- Returns:
- The web page that owns this class.
-
getSource
public final WebPage getSource()
- Returns:
- The web page that this range is owned by.
-
getTextOnly
public final java.lang.String getTextOnly()
Get the text from this range.- Returns:
- The text from this range.
-
setBegin
public final void setBegin(int theBegin)
Set the beginning index.- Parameters:
theBegin- The beginning index.
-
setClassAttribute
public final void setClassAttribute(java.lang.String theClassAttribute)
- Parameters:
theClassAttribute- the classAttribute to set
-
setEnd
public final void setEnd(int theEnd)
Set the ending index.- Parameters:
theEnd- The ending index.
-
setIdAttribute
public final void setIdAttribute(java.lang.String id)
- Parameters:
id- the idAttribute to set
-
setParent
public final void setParent(DocumentRange theParent)
Set the parent.- Parameters:
theParent- The parent.
-
setSource
public final void setSource(WebPage theSource)
Set the source web page.- Parameters:
theSource- The source web page.
-
-
DMelt 3.0 © DataMelt by jWork.ORG