Query Cycle Simulator HEADER

qcsim.content.impl
Class PeerContentManagerImpl

java.lang.Object
  |
  +--qcsim.content.impl.PeerContentManagerImpl
All Implemented Interfaces:
PeerContentManager

public class PeerContentManagerImpl
extends java.lang.Object
implements PeerContentManager

Represents the total content of a given peer.

Version:
1.0
Author:
unascribed

Field Summary
 
Fields inherited from interface qcsim.content.PeerContentManager
BOTTOM_CATEGORY, RANDOM_CATEGORY, SAROIU, TOP_CATEGORY, UNIFORMRANDOM
 
Constructor Summary
PeerContentManagerImpl(int contentCategories, int lowerBound, int dist)
          Constructor
 
Method Summary
 int contentCategories()
          The total number of content categories in the system.
 void distributeFiles()
          This should be called once all peer content objects have been created.
 double normFactor(int category)
          Get the category normalization factor.
 PeerContent peerContent(int categoryPreference)
          Fuction will initialize a peer's content by assigning a number of content category and a giving each content category a level of interest
 int uniqueFiles(int category)
          Get the number of unique files in category
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PeerContentManagerImpl

public PeerContentManagerImpl(int contentCategories,
                              int lowerBound,
                              int dist)
Constructor

Method Detail

contentCategories

public int contentCategories()
The total number of content categories in the system.

Specified by:
contentCategories in interface PeerContentManager
Returns:
total number of content categories.

normFactor

public double normFactor(int category)
Get the category normalization factor.

Specified by:
normFactor in interface PeerContentManager
Returns:
category normalization factor.

uniqueFiles

public int uniqueFiles(int category)
Get the number of unique files in category

Specified by:
uniqueFiles in interface PeerContentManager
Parameters:
category - The Content category.
Returns:
The number of unique files in the category.

peerContent

public PeerContent peerContent(int categoryPreference)
Fuction will initialize a peer's content by assigning a number of content category and a giving each content category a level of interest

Specified by:
peerContent in interface PeerContentManager
Parameters:
categoryPreference - Specifies an category selection preference.

distributeFiles

public void distributeFiles()
This should be called once all peer content objects have been created. This will then initialze the peer content objects with actual files.

Specified by:
distributeFiles in interface PeerContentManager

Query Cycle Simulator HEADER