cz.cuni.amis.utils
Class Iterators<NODE>

Package class diagram package Iterators
java.lang.Object
  extended by cz.cuni.amis.utils.Iterators<NODE>
Type Parameters:
NODE -
All Implemented Interfaces:
Iterable<NODE>, Iterator<NODE>

public class Iterators<NODE>
extends Object
implements Iterator<NODE>, Iterable<NODE>

This class allows you to combine several iterators in the single one allowing you to seamlessly iterate over several collections at once.

This class behaves as defined by Iterator contract.

Author:
Jimmy

Constructor Summary
Iterators(Iterable<NODE>... iterables)
          Initialize this class to use "iterators" from 'iterables' in the order as they are passed into the constructor.
Iterators(Iterator<NODE>... iterators)
          Initialize this class to use "iterators" in the order as they are passed into the constructor.
 
Method Summary
 boolean hasNext()
           
 Iterator<NODE> iterator()
           
 NODE next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Iterators

public Iterators(Iterator<NODE>... iterators)
Initialize this class to use "iterators" in the order as they are passed into the constructor.

Parameters:
iterators - may contain nulls

Iterators

public Iterators(Iterable<NODE>... iterables)
Initialize this class to use "iterators" from 'iterables' in the order as they are passed into the constructor.

Parameters:
iterators - may contain nulls
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface Iterator<NODE>

next

public NODE next()
Specified by:
next in interface Iterator<NODE>

remove

public void remove()
Specified by:
remove in interface Iterator<NODE>

iterator

public Iterator<NODE> iterator()
Specified by:
iterator in interface Iterable<NODE>


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.