|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface defines the functions to represent a group of Publications. It should support various operations on a group of Publications like returning an iterator over the group, adding a Publication to the group, testing whether a Publication is a member of the group, retrieving random Publications, unioning with another PublicationGroup, etc.
A major constraint on the PublicationGroup is to include only Publications as its members.
Publication| Method Summary | |
void |
addPublication(Publication publication)
Adds a Publication to the group |
boolean |
containsPublication(Publication publication)
Tests whether the Group contains the Publication or not |
java.util.Iterator |
getIterator()
Returns the Iterator over the Group of Publications. |
java.util.Collection |
getPublications()
Returns the Collection of Publications in the Group |
Publication |
getRandomPublication()
Returns a Random Publication from the PublicationGroup |
PublicationGroup |
getRandomPublications(int numElements)
Returns the specified number of distinct random Publications from the PublicationGroup as a PublicationGroup. |
void |
initialize(java.util.Collection collection)
Initializes the group of Publications with the specified Collection |
boolean |
isSubset(PublicationGroup publication_group)
Tests whether the specified PublicationGroup |
void |
removeAllPublications()
Removes all the Publication from the Group |
int |
size()
Returns the number of Publications in the Group |
void |
union(PublicationGroup publicationGroupInterface)
Modifies the PublicationGroup to be the union of itself and the specified PublicationGroup. |
| Method Detail |
public void initialize(java.util.Collection collection)
Publications with the specified Collection
collection - Specifies the collection of publicationspublic java.util.Collection getPublications()
Collection of Publications in the Group
public java.util.Iterator getIterator()
Iterator over the Group of Publications. The Iterator should iterate only over the non-duplicate members of the PublicationGroup. The order of iteration does not matter as long as it covers all the non-duplicate members of the Group.
public int size()
Publications in the Group
public void addPublication(Publication publication)
Publication to the group
publication - Specifies the publication to be addedpublic void removeAllPublications()
Publication from the Group
public boolean containsPublication(Publication publication)
Publication or not
publication - Specifies the publication to be tested
public Publication getRandomPublication()
Publication from the PublicationGroup
public PublicationGroup getRandomPublications(int numElements)
Publications from the PublicationGroup as a PublicationGroup. If the specified number is larger than the size of the PublicationGroup, the entire PublicationGroup is returned.
numElements - Specifies the number of publications required
public void union(PublicationGroup publicationGroupInterface)
PublicationGroup to be the union of itself and the specified PublicationGroup. It acts like the operation (a = a union b), where a is the current PublicationGroup and b is the specified PublicationGroup
publicationGroupInterface - Specifies the publication group to be unioned withpublic boolean isSubset(PublicationGroup publication_group)
PublicationGroup is a subset of the current one
- Parameters:
publication_group - Specifies the publication group to be tested
- Returns:
- true, if publication_group is a subset of the current publication
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||