com.jdroid.java.collections
Class Iterables

java.lang.Object
  extended by com.jdroid.java.collections.Iterables

public class Iterables
extends Object


Constructor Summary
Iterables()
           
 
Method Summary
static int size(Iterable<?> iterable)
          Returns the number of elements in iterable.
static
<T> T[]
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
 

Constructor Detail

Iterables

public Iterables()
Method Detail

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 copy
type - 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.