Parser.LinkReceiver
, java.lang.Iterable<java.net.URI>
public static final class HTMLParser.SetLinkReceiver extends java.lang.Object implements Parser.LinkReceiver
Parser.LinkReceiver
that accumulates the URLs in a public set.Modifier and Type | Field | Description |
---|---|---|
java.util.Set<java.net.URI> |
urls |
The set of URLs gathered so far.
|
Constructor | Description |
---|---|
SetLinkReceiver() |
Modifier and Type | Method | Description |
---|---|---|
void |
init(java.net.URI responseUrl) |
Initializes this receiver for a new page.
|
java.util.Iterator<java.net.URI> |
iterator() |
|
void |
link(java.net.URI link) |
Handles a link.
|
void |
location(java.net.URI location) |
Handles the location defined by headers.
|
void |
metaLocation(java.net.URI location) |
Handles the location defined by a
META element. |
void |
metaRefresh(java.net.URI refresh) |
Handles the refresh defined by a
META element. |
int |
size() |
public void location(java.net.URI location)
Parser.LinkReceiver
location
in interface Parser.LinkReceiver
location
- the location defined by headers.public void metaLocation(java.net.URI location)
Parser.LinkReceiver
META
element.metaLocation
in interface Parser.LinkReceiver
location
- the location defined by the META
element.public void metaRefresh(java.net.URI refresh)
Parser.LinkReceiver
META
element.metaRefresh
in interface Parser.LinkReceiver
refresh
- the URL defined by the META
element.public void link(java.net.URI link)
Parser.LinkReceiver
link
in interface Parser.LinkReceiver
link
- a link discovered during the parsing phase.public void init(java.net.URI responseUrl)
Parser.LinkReceiver
init
in interface Parser.LinkReceiver
responseUrl
- the URL of the page to be parsed.public java.util.Iterator<java.net.URI> iterator()
iterator
in interface java.lang.Iterable<java.net.URI>
public int size()
size
in interface Parser.LinkReceiver