TrueZIP Kernel 7.0-rc1

de.schlichtherle.truezip.util
Class JointIterator<E>

java.lang.Object
  extended by de.schlichtherle.truezip.util.JointIterator<E>
All Implemented Interfaces:
Iterator<E>

@NotThreadSafe
public final class JointIterator<E>
extends Object
implements Iterator<E>

An iterator which concatenates the elements of two other iterators.

Author:
Christian Schlichtherle

Field Summary
private  Iterator<? extends E> i1
           
private  Iterator<? extends E> i2
           
 
Constructor Summary
JointIterator(Iterable<? extends E> i1, Iterable<? extends E> i2)
          Constructs a new JointIterator from the given iterables.
JointIterator(Iterator<? extends E> i1, Iterator<? extends E> i2)
          Constructs a new JointIterator from the given iterators.
 
Method Summary
 boolean hasNext()
           
 E next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i1

private Iterator<? extends E> i1

i2

private Iterator<? extends E> i2
Constructor Detail

JointIterator

public JointIterator(Iterator<? extends E> i1,
                     Iterator<? extends E> i2)
Constructs a new JointIterator from the given iterators.

Parameters:
i1 - the first iterator.
i2 - the second iterator.
Throws:
NullPointerException - if any parameter is null.

JointIterator

public JointIterator(Iterable<? extends E> i1,
                     Iterable<? extends E> i2)
Constructs a new JointIterator from the given iterables.

Parameters:
i1 - the first iterable.
i2 - the second iterable.
Throws:
NullPointerException - if any parameter is null.
Method Detail

hasNext

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

next

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

remove

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

TrueZIP Kernel 7.0-rc1

Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.