org.jnario.lib
Class JnarioIterableExtensions

java.lang.Object
  extended by org.jnario.lib.JnarioIterableExtensions

public class JnarioIterableExtensions
extends Object


Constructor Summary
JnarioIterableExtensions()
           
 
Method Summary
static
<T> T
fifth(Iterable<T> iterable)
           
static
<T> T
first(Iterable<?> iterator, Class<T> type)
           
static
<T> T
first(Iterable<T> iterable)
           
static
<T> T
forth(Iterable<T> iterable)
           
static
<T> T
get(Iterable<T> iterable, int index)
          Returns the element at the specified position in the arguments.
static
<T> T
second(Iterable<?> iterator, Class<T> type)
           
static
<T> T
second(Iterable<T> iterable)
           
static
<T> T
third(Iterable<T> iterable)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JnarioIterableExtensions

public JnarioIterableExtensions()
Method Detail

get

public static <T> T get(Iterable<T> iterable,
                        int index)
Returns the element at the specified position in the arguments.

Parameters:
index - index of the element to return
Returns:
the element at the specified position in this argument list
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size())

first

public static <T> T first(Iterable<T> iterable)
Returns:
the first argument

second

public static <T> T second(Iterable<T> iterable)
Returns:
the second argument

third

public static <T> T third(Iterable<T> iterable)
Returns:
the third argument

forth

public static <T> T forth(Iterable<T> iterable)
Returns:
the forth argument

fifth

public static <T> T fifth(Iterable<T> iterable)
Returns:
the fifth argument

first

public static <T> T first(Iterable<?> iterator,
                          Class<T> type)
Returns:
the first argument with the specified type

second

public static <T> T second(Iterable<?> iterator,
                           Class<T> type)
Returns:
the second argument with the specified type


Copyright © 2012-2013 BMW Car IT. All Rights Reserved.