ca.mcgill.cs.postina.util
Class ListTransformation

java.lang.Object
  extended by ca.mcgill.cs.postina.util.ListTransformation

public class ListTransformation
extends java.lang.Object

The class Util contains some static methods that are useful for the internal implementation of Postina.

Version:
Oct 23, 2007
Author:
Dominik Zindel

Constructor Summary
ListTransformation()
           
 
Method Summary
static java.util.Collection<java.util.Collection<rice.p2p.scribe.Topic>> getLimitedLengthTopicArrayList(java.util.Collection<ScribeTopic> coll)
          This static method takes a collection of ScribeTopics as input and casts all elements of the collection to a Topic to return them in a collection containing collections.
static java.util.Collection<PostinaTopic> getPostinaTopicCollection(java.util.Collection<rice.p2p.scribe.Topic> coll)
          This static method takes a collection of code Topics as input and casts all elements of the collection to PostinaTopics.
static java.util.Collection<ScribeTopic> getScribeTopicArrayList(java.util.Collection<PostinaTopic> coll)
          This static method takes a collection of PostinaTopics as input and casts all elements of the collection to a ScribeTopic.
static java.util.Collection<rice.p2p.scribe.Topic> getTopicArrayList(java.util.Collection<ScribeTopic> coll)
          This static method takes a collection of ScribeTopics as input and casts all elements of the collection to a Topic.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ListTransformation

public ListTransformation()
Method Detail

getLimitedLengthTopicArrayList

public static java.util.Collection<java.util.Collection<rice.p2p.scribe.Topic>> getLimitedLengthTopicArrayList(java.util.Collection<ScribeTopic> coll)
This static method takes a collection of ScribeTopics as input and casts all elements of the collection to a Topic to return them in a collection containing collections. of maximal size 100.

Parameters:
coll - The collection of ScribeTopics that should be casted.
Returns:
A collection of collections each containing at maximum 100 Topics representing the same topics as the input collection.

getPostinaTopicCollection

public static java.util.Collection<PostinaTopic> getPostinaTopicCollection(java.util.Collection<rice.p2p.scribe.Topic> coll)
This static method takes a collection of code Topics as input and casts all elements of the collection to PostinaTopics.

Parameters:
coll - The collection of Topics that should be casted.
Returns:
A collection of PostinaTopics representing the same topics as the input collection.

getScribeTopicArrayList

public static java.util.Collection<ScribeTopic> getScribeTopicArrayList(java.util.Collection<PostinaTopic> coll)
This static method takes a collection of PostinaTopics as input and casts all elements of the collection to a ScribeTopic.

Parameters:
coll - The collection of PostinaTopics that should be casted.
Returns:
A collection of ScribeTopics representing the same topics as the input collection.

getTopicArrayList

public static java.util.Collection<rice.p2p.scribe.Topic> getTopicArrayList(java.util.Collection<ScribeTopic> coll)
This static method takes a collection of ScribeTopics as input and casts all elements of the collection to a Topic.

Parameters:
coll - The collection of ScribeTopics that should be casted.
Returns:
A collection of Topics representing the same topics as the input collection.