Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.encog.bot.browse
Class WebPage

    java.lang.Object
      org.encog.bot.browse.WebPage

    public class WebPage

extends Object

Holds 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.

Author:
  jheaton

Constructor Summary
`WebPage()`

Method Summary
`void` | `addContent(DocumentRange span)` Add to the content collection.
`void` | `addDataUnit(DataUnit unit)` Add a data unit to the collection.
`DocumentRange` | `find(Class<?> c, int index)` Find the specified DocumentRange subclass in the contents list.
`Link` | `findLink(String str)` Find the link that contains the specified string.
`List<DocumentRange>` | `getContents()`
`List<DataUnit>` | `getData()`
`int` | `getDataSize()` Get the number of data items in this collection.
`DataUnit` | `getDataUnit(int i)` Get the DataUnit unit at the specified index.
`DocumentRange` | `getTitle()` Get the title for this document.
`void` | `setTitle(DocumentRange theTitle)` Set the title of this document.
`String` | `toString()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### WebPage

    public WebPage()

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(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(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 List<DocumentRange> getContents()

  Returns:
    The contents in a list collection.

### getData

    public final 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 String toString()

  Overrides:
    `toString` in class `Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011. All Rights Reserved.