Query Cycle Simulator HEADER

qcsim.content
Interface Content

All Known Implementing Classes:
ContentImpl

public interface Content

This interface represents a given content category. It contains a files associated with the content category and is given to a peer as part of its shared data.

Version:
1.0
Author:
unascribed

Field Summary
static double BAD_FILE
           
static double GOOD_FILE
           
 
Method Summary
 boolean addFile(int rank)
          Add the file rank to this content category
 int category()
          The content category id.
 boolean containsFile(int rank)
          Search for the file rank in this content category
 int files()
          The number of files.
 double interest()
          The peers interest level in this content category.
 void interest(double interest)
          Set the peers interest level in this content category.
 int volume()
          The total volume of data (number of files) in this content category.
 void volume(int volume)
          Set the total volume of data (number of files) in this content category
 

Field Detail

BAD_FILE

public static final double BAD_FILE
See Also:
Constant Field Values

GOOD_FILE

public static final double GOOD_FILE
See Also:
Constant Field Values
Method Detail

category

public int category()
The content category id.

Returns:
category id.

interest

public double interest()
The peers interest level in this content category.


interest

public void interest(double interest)
Set the peers interest level in this content category.


volume

public int volume()
The total volume of data (number of files) in this content category.


volume

public void volume(int volume)
Set the total volume of data (number of files) in this content category


files

public int files()
The number of files.

Returns:
The number of files.

containsFile

public boolean containsFile(int rank)
Search for the file rank in this content category

Parameters:
rank - the file to search.
Returns:
whether the content contains the file.

addFile

public boolean addFile(int rank)
Add the file rank to this content category

Parameters:
rank - file to add.
Returns:
true if file was successfully added.

Query Cycle Simulator HEADER