public final class CollectionUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <E> FastCollection<E> |
emptyFastCollection()
Create an empty, immutable fast collection.
|
static <E> Iterable<E> |
fast(Iterable<E> iter)
Use the fast iterator of an iterable, if available.
|
static it.unimi.dsi.fastutil.ints.IntList |
interval(int from,
int to)
Create an
IntList that contains all numbers in a specified interval. |
static <E> it.unimi.dsi.fastutil.objects.ObjectCollection<E> |
objectCollection(Collection<E> objects)
Wrap a
Collection in an ObjectCollection. |
static <T> List<T> |
repeat(T obj,
int n)
Return a list that repeats a single object multiple times.
|
public static <E> Iterable<E> fast(Iterable<E> iter)
E - The type of object to iterate.iter - An iterable to wrapfastIterator()
method, like is present in Long2DoubleMap.FastEntrySet.public static <E> it.unimi.dsi.fastutil.objects.ObjectCollection<E> objectCollection(Collection<E> objects)
Collection in an ObjectCollection.E - The type of objects.objects - The collection of objects.ObjectCollection.public static <T> List<T> repeat(T obj, int n)
T - The type of list elements.obj - The object.n - The size of the list.public static <E> FastCollection<E> emptyFastCollection()
E - The type of fast collection.public static it.unimi.dsi.fastutil.ints.IntList interval(int from,
int to)
IntList that contains all numbers in a specified interval.from - The first number (inclusive)to - the last number (exclusive).[from,to).Copyright © 2013 GroupLens Research. All Rights Reserved.