Package crawlercommons.sitemaps
Class SiteMapIndex
- java.lang.Object
-
- crawlercommons.sitemaps.AbstractSiteMap
-
- crawlercommons.sitemaps.SiteMapIndex
-
- All Implemented Interfaces:
Serializable
public class SiteMapIndex extends AbstractSiteMap
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class crawlercommons.sitemaps.AbstractSiteMap
AbstractSiteMap.SitemapType
-
-
Field Summary
-
Fields inherited from class crawlercommons.sitemaps.AbstractSiteMap
TIME_ZONE_UTC, url, W3C_FULLDATE_FORMATTER, W3C_FULLDATE_FORMATTER_UTC, W3C_SHORTDATE_FORMATTER
-
-
Constructor Summary
Constructors Constructor Description SiteMapIndex()SiteMapIndex(URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSitemap(AbstractSiteMap sitemap)Add this Sitemap to the list of Sitemaps,AbstractSiteMapgetSitemap(URL url)Returns the Sitemap that has the given URL.Collection<AbstractSiteMap>getSitemaps()Collection<AbstractSiteMap>getSitemaps(boolean deduplicate)booleanhasUnprocessedSitemap()booleanisIndex()AbstractSiteMapnextUnprocessedSitemap()StringtoString()-
Methods inherited from class crawlercommons.sitemaps.AbstractSiteMap
convertToDate, convertToZonedDateTime, getLastModified, getType, getUrl, isProcessed, normalizeRSSTimestamp, parseRSSTimestamp, setLastModified, setLastModified, setLastModified, setProcessed, setType
-
-
-
-
Constructor Detail
-
SiteMapIndex
public SiteMapIndex()
-
SiteMapIndex
public SiteMapIndex(URL url)
-
-
Method Detail
-
getSitemaps
public Collection<AbstractSiteMap> getSitemaps()
- Returns:
- a Collection of Sitemaps in this Sitemap Index.
-
getSitemaps
public Collection<AbstractSiteMap> getSitemaps(boolean deduplicate)
- Parameters:
deduplicate- deduplicate sitemaps by URL: from two or more sitemaps pointing to the same URL only the first is kept in the returned collection- Returns:
- the (deduplicated) Collection of Sitemaps in this Sitemap Index.
-
addSitemap
public void addSitemap(AbstractSiteMap sitemap)
Add this Sitemap to the list of Sitemaps,- Parameters:
sitemap- - Sitemap to be added to the list of Sitemaps
-
getSitemap
public AbstractSiteMap getSitemap(URL url)
Returns the Sitemap that has the given URL. Returns null if the URL cannot be found.- Parameters:
url- - The Sitemap's URL- Returns:
- SiteMap corresponding to the URL or null
-
hasUnprocessedSitemap
public boolean hasUnprocessedSitemap()
- Returns:
- true if there are Sitemaps in this index that have not been processed yet, false otherwise.
-
nextUnprocessedSitemap
public AbstractSiteMap nextUnprocessedSitemap()
- Returns:
- an unprocessed Sitemap or null if no unprocessed Sitemaps could be found.
-
isIndex
public boolean isIndex()
- Overrides:
isIndexin classAbstractSiteMap
-
-