LimeWire Collection Component API

org.limewire.collection
Class CollectionUtils

java.lang.Object
  extended by org.limewire.collection.CollectionUtils

public class CollectionUtils
extends Object


Method Summary
static
<T> Collection<T>
flatten(Collection<? extends Collection<? extends T>> values)
          Flattens the collections into a single collection.
static
<T> List<T>
listOf(Iterable<T> iterable)
           
static
<T> List<T>
listOf(Iterator<T> iterator)
           
static
<T> Iterator<T>
readOnlyIterator(Iterator<T> iterator)
           
static
<T> List<T>
toList(Collection<T> c)
          Converts the given Collection to a List (if it isn't already a List)
static
<T> Set<T>
toSet(Collection<T> c)
          Converts the given Collection to a Set (if it isn't already a Set)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

listOf

public static <T> List<T> listOf(Iterator<T> iterator)

listOf

public static <T> List<T> listOf(Iterable<T> iterable)

toSet

public static <T> Set<T> toSet(Collection<T> c)
Converts the given Collection to a Set (if it isn't already a Set)


toList

public static <T> List<T> toList(Collection<T> c)
Converts the given Collection to a List (if it isn't already a List)


readOnlyIterator

public static <T> Iterator<T> readOnlyIterator(Iterator<T> iterator)

flatten

public static <T> Collection<T> flatten(Collection<? extends Collection<? extends T>> values)
Flattens the collections into a single collection. The returned value is a copy, not a view.


LimeWire Collection Component API

Copyright © 2009 Lime Wire LLC. All Rights Reserved.