public class URLCollection
extends java.lang.Object
implements java.lang.Iterable<java.net.URL>
Before a URL is added to the collection, it is wrapped in a URLString class. The iterator unwraps the URL before return.
N.B. Designed for use by HTMLParser, so is not a full implementation - e.g. does not support remove()
Constructor and Description |
---|
URLCollection(java.util.Collection<URLString> c)
Creates a new URLCollection from an existing Collection
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(java.net.URL u)
Adds the URL to the Collection, first wrapping it in the URLString class
|
boolean |
addURL(java.lang.String url,
java.net.URL baseUrl)
Convenience method for adding URLs to the collection.
|
java.util.Iterator<java.net.URL> |
iterator() |
public URLCollection(java.util.Collection<URLString> c)
c
- collection to start with (Must not be null
)public boolean add(java.net.URL u)
u
- URL to addpublic boolean addURL(java.lang.String url, java.net.URL baseUrl)
null
, empty or URL is malformed, nothing is
doneurl
- String, may be null or emptybaseUrl
- base for url
to add information, which might be
missing in url
public java.util.Iterator<java.net.URL> iterator()
iterator
in interface java.lang.Iterable<java.net.URL>
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.