p2ps.imp.discovery.cache
Class AdvertisementCache
java.lang.Object
p2ps.imp.discovery.cache.AdvertisementCache
- public class AdvertisementCache
- extends java.lang.Object
A index of cache ids for adverts keyed by advert type. Queries are
additionally keyed by query type
- Version:
- $Revision: 295 $
- Author:
- Ian Wang
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AdvertisementCache
public AdvertisementCache()
init
public void init(java.io.File file,
Peer peer)
throws java.io.IOException
- Throws:
java.io.IOException
cache
public void cache(Advertisement advert)
throws java.io.IOException
- Indexes an advert and its associated cache id.
- Throws:
java.io.IOException
advertIterator
public java.util.Iterator advertIterator()
- Returns:
- an iterator for all adverts
advertIterator
public java.util.Iterator advertIterator(java.lang.String type)
- Returns:
- an iterator for the specified advert type
queryIterator
public java.util.Iterator queryIterator()
- Returns:
- an iterator for all adverts
queryIterator
public java.util.Iterator queryIterator(java.lang.String type)
- Returns:
- an iterator of queries for the specified query type
dispose
public void dispose()
- Disposes the advertisement cache
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception