Package org.encog.bot.dataunit

Examples of org.encog.bot.dataunit.DataUnit


   */
  public final String getTextOnly() {
    final StringBuilder result = new StringBuilder();

    for (int i = getBegin(); i < getEnd(); i++) {
      final DataUnit du = this.source.getData().get(i);
      if (du instanceof TextDataUnit) {
        result.append(du.toString());
        result.append("\n");
      }
    }

    return result.toString();
View Full Code Here


  public final int findEndTag(final int index, final Tag tag) {
    int depth = 0;
    int count = index;

    while (count < this.page.getDataSize()) {
      final DataUnit du = this.page.getDataUnit(count);

      if (du instanceof TagDataUnit) {
        final Tag nextTag = ((TagDataUnit) du).getTag();
        if (tag.getName().equalsIgnoreCase(nextTag.getName())) {
          if (nextTag.getType() == Tag.Type.END) {
View Full Code Here

   * load the contents of the web page. This includes the title, any links and
   * forms. Div tags and spans are also processed.
   */
  protected final void loadContents() {
    for (int index = 0; index < this.page.getDataSize(); index++) {
      final DataUnit du = this.page.getDataUnit(index);
      if (du instanceof TagDataUnit) {
        final Tag tag = ((TagDataUnit) du).getTag();

        if (tag.getType() != Tag.Type.END) {
          if (tag.getName().equalsIgnoreCase("a")) {
View Full Code Here

   */
  public final String getTextOnly() {
    final StringBuilder result = new StringBuilder();

    for (int i = getBegin(); i < getEnd(); i++) {
      final DataUnit du = this.source.getData().get(i);
      if (du instanceof TextDataUnit) {
        result.append(du.toString());
        result.append("\n");
      }
    }

    return result.toString();
View Full Code Here

  public final int findEndTag(final int index, final Tag tag) {
    int depth = 0;
    int count = index;

    while (count < this.page.getDataSize()) {
      final DataUnit du = this.page.getDataUnit(count);

      if (du instanceof TagDataUnit) {
        final Tag nextTag = ((TagDataUnit) du).getTag();
        if (tag.getName().equalsIgnoreCase(nextTag.getName())) {
          if (nextTag.getType() == Tag.Type.END) {
View Full Code Here

   * load the contents of the web page. This includes the title, any links and
   * forms. Div tags and spans are also processed.
   */
  protected final void loadContents() {
    for (int index = 0; index < this.page.getDataSize(); index++) {
      final DataUnit du = this.page.getDataUnit(index);
      if (du instanceof TagDataUnit) {
        final Tag tag = ((TagDataUnit) du).getTag();

        if (tag.getType() != Tag.Type.END) {
          if (tag.getName().equalsIgnoreCase("a")) {
View Full Code Here

TOP

Related Classes of org.encog.bot.dataunit.DataUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.