View Javadoc

    1   /* URIFrontierMarker
    2    *
    3    * $Id: FrontierMarker.java 2593 2004-09-30 02:16:06Z gojomo $
    4    *
    5    * Created on Feb 25, 2004
    6    *
    7    * Copyright (C) 2004 Internet Archive.
    8    *
    9    * This file is part of the Heritrix web crawler (crawler.archive.org).
    10   *
    11   * Heritrix is free software; you can redistribute it and/or modify
    12   * it under the terms of the GNU Lesser Public License as published by
    13   * the Free Software Foundation; either version 2.1 of the License, or
    14   * any later version.
    15   *
    16   * Heritrix is distributed in the hope that it will be useful,
    17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    19   * GNU Lesser Public License for more details.
    20   *
    21   * You should have received a copy of the GNU Lesser Public License
    22   * along with Heritrix; if not, write to the Free Software
    23   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    24   */
    25  package org.archive.crawler.framework;
    26
    27
    28  /***
    29   * A marker is a pointer to a place somewhere inside a frontier's list of
    30   * pending URIs. URIFrontiers use them to allow outside classes (UI for
    31   * example) to hold (effectively) pointers into the abstract list of pending
    32   * URIs inside the frontier. If the crawl is not paused (i.e. running) the
    33   * marker will instantly become out of date.
    34   *
    35   * @author Kristinn Sigurdsson
    36   */
    37  public interface FrontierMarker {
    38
    39      /***
    40       * Returns the regular expression that this marker uses.
    41       * @return the regular expression that this marker uses
    42       */
    43      public String getMatchExpression();
    44
    45      /***
    46       * Returns the number of the next match after the marker.
    47       * Alternatively this can be viewed as n-1, where n is the number of items
    48       * found before the marker.
    49       * @return the number of the next match after the marker
    50       */
    51      public long getNextItemNumber();
    52
    53      /***
    54       * Returns false if no more URIs can be found matching the expression
    55       * beyond those already covered. True otherwise.
    56       * @return Are there any more matches.
    57       */
    58      public boolean hasNext();
    59  }