org.jnario.lib
Class JnarioIteratorExtensions

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

public class JnarioIteratorExtensions
extends Object


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

Constructor Detail

JnarioIteratorExtensions

public JnarioIteratorExtensions()
Method Detail

get

public static <T> T get(Iterator<T> iterator,
                        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(Iterator<T> iterator)
Returns:
the first argument

second

public static <T> T second(Iterator<T> iterator)
Returns:
the second argument

third

public static <T> T third(Iterator<T> iterator)
Returns:
the third argument

forth

public static <T> T forth(Iterator<T> iterator)
Returns:
the forth argument

fifth

public static <T> T fifth(Iterator<T> iterator)
Returns:
the fifth argument

first

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

second

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


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