com.jdroid.java.collections
Class Iterables
java.lang.Object
com.jdroid.java.collections.Iterables
public class Iterables
- extends Object
|
Method Summary |
static int |
size(Iterable<?> iterable)
Returns the number of elements in iterable. |
static
|
toArray(Iterable<? extends T> iterable,
Class<T> type)
Copies an iterable's elements into an array. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Iterables
public Iterables()
size
public static int size(Iterable<?> iterable)
- Returns the number of elements in
iterable.
- Parameters:
iterable - The Iterable
- Returns:
- The
Iterable size
toArray
public static <T> T[] toArray(Iterable<? extends T> iterable,
Class<T> type)
- Copies an iterable's elements into an array.
- Parameters:
iterable - the iterable to copytype - the type of the elements
- Returns:
- a newly-allocated array into which all the elements of the iterable have been copied
Copyright © 2014. All rights reserved.