edu.iu.iv.modeling.tarl.util
Interface AuthorsTopicBucket

All Known Implementing Classes:
DefaultAuthorsTopicBucket

public interface AuthorsTopicBucket

This interface defines the concept of a group of Authors all having the same Topic. The AuthorsTopicBucket stores a Topic that represents the common Topic of all the Authors. An Author is added only if his/her Topic is the same as the Topic of the AuthorsTopicBucket.

Author:
Jeegar T Maru
See Also:
AuthorGroup, Topic

Method Summary
 void addAuthor(Author author)
          Adds an Author only if his/her Topic is the same as that of the Bucket
 AuthorGroup getAuthors()
          Returns the AuthorGroup that the AuthorsTopicBucket stores
 Topic getTopic()
          Returns the common Topic of the AuthorGroup
 void initialize(java.util.Collection collection)
          Initializes the Bucket with Authors from the collection.
 java.util.Collection partitionBucket(int numElements)
          Returns a Collection of AuthorsTopicBuckets of randomly chosen Authors such that the individual buckets are mutually exclusive and exhaustive (they cover all the authors).
 

Method Detail

initialize

public void initialize(java.util.Collection collection)
Initializes the Bucket with Authors from the collection. It can assume that the collection contains AuthorInterfaces

Parameters:
collection - Specifies the collection of authors

addAuthor

public void addAuthor(Author author)
Adds an Author only if his/her Topic is the same as that of the Bucket

Parameters:
author - the author to be added to the bucket

getTopic

public Topic getTopic()
Returns the common Topic of the AuthorGroup

Returns:
the common topic of the authors

getAuthors

public AuthorGroup getAuthors()
Returns the AuthorGroup that the AuthorsTopicBucket stores

Returns:
the group of authors

partitionBucket

public java.util.Collection partitionBucket(int numElements)
Returns a Collection of AuthorsTopicBuckets of randomly chosen Authors such that the individual buckets are mutually exclusive and exhaustive (they cover all the authors). All the buckets are of the fixed specified size except a very few which could hold less number of Authors.

Parameters:
numElements - the number of elements in most of the individual buckets
Returns:
a collection of AuthorsTopicBuckets