LimeWire collection component api

org.limewire.collection
Class CollectionUtils

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

public class CollectionUtils
extends java.lang.Object


Method Summary
static
<T> java.util.Collection<T>
flatten(java.util.Collection<? extends java.util.Collection<? extends T>> values)
          Flattens the collections into a single collection.
static
<T> java.util.List<T>
listOf(java.lang.Iterable<T> iterable)
           
static
<T> java.util.List<T>
listOf(java.util.Iterator<T> iterator)
           
static
<T> java.util.Iterator<T>
readOnlyIterator(java.util.Iterator<T> iterator)
           
static
<T> java.util.List<T>
toList(java.util.Collection<T> c)
          Converts the given Collection to a List (if it isn't already a List).
static
<T> java.util.Set<T>
toSet(java.util.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> java.util.List<T> listOf(java.util.Iterator<T> iterator)

listOf

public static <T> java.util.List<T> listOf(java.lang.Iterable<T> iterable)

toSet

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


toList

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


readOnlyIterator

public static <T> java.util.Iterator<T> readOnlyIterator(java.util.Iterator<T> iterator)

flatten

public static <T> java.util.Collection<T> flatten(java.util.Collection<? extends java.util.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.