01: /* URIFrontierMarker
02: *
03: * $Id: FrontierMarker.java 2593 2004-09-30 02:16:06Z gojomo $
04: *
05: * Created on Feb 25, 2004
06: *
07: * Copyright (C) 2004 Internet Archive.
08: *
09: * 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: * A marker is a pointer to a place somewhere inside a frontier's list of
29: * pending URIs. URIFrontiers use them to allow outside classes (UI for
30: * example) to hold (effectively) pointers into the abstract list of pending
31: * URIs inside the frontier. If the crawl is not paused (i.e. running) the
32: * marker will instantly become out of date.
33: *
34: * @author Kristinn Sigurdsson
35: */
36: public interface FrontierMarker {
37:
38: /**
39: * Returns the regular expression that this marker uses.
40: * @return the regular expression that this marker uses
41: */
42: public String getMatchExpression();
43:
44: /**
45: * Returns the number of the next match after the marker.
46: * Alternatively this can be viewed as n-1, where n is the number of items
47: * found before the marker.
48: * @return the number of the next match after the marker
49: */
50: public long getNextItemNumber();
51:
52: /**
53: * Returns false if no more URIs can be found matching the expression
54: * beyond those already covered. True otherwise.
55: * @return Are there any more matches.
56: */
57: public boolean hasNext();
58: }
|