Query Cycle Simulator HEADER

qcsim.content
Interface PeerContent

All Known Implementing Classes:
PeerContentImpl

public interface PeerContent

Interface to a peer's content.

Version:
1.0
Author:
unascribed

Method Summary
 int categories()
          The number of content categories this peer contains.
 Content category(int category)
          Get the content category
 java.util.Iterator iterator()
          Iterator for all content categories owned by this peer.
 PeerContentManager manager()
          The manager of this PeerContent object.
 int randomCategory()
          Choose a random category to download from
 int randomFile(int category)
          Choose a random file to download.
 

Method Detail

manager

public PeerContentManager manager()
The manager of this PeerContent object.

Returns:
The Peer Content Manager.

categories

public int categories()
The number of content categories this peer contains.

Returns:
the number of content categories.

iterator

public java.util.Iterator iterator()
Iterator for all content categories owned by this peer.

Returns:
iterator of content categories.

category

public Content category(int category)
Get the content category


randomCategory

public int randomCategory()
Choose a random category to download from

Returns:
the category

randomFile

public int randomFile(int category)
Choose a random file to download. This will not pick a file already owned. It will also prefer highly ranked files.

Parameters:
category - choose file from this content category
Returns:
the file choosen.

Query Cycle Simulator HEADER