# Class IterableAdapter<T>

java.lang.Object
htsjdk.samtools.util.IterableAdapter<T>

All Implemented Interfaces:
  `Iterable<T>`

public class IterableAdapter<T> extends Object implements Iterable<T>
Provides an adapter to wrap an Iterator with an Iterable, allowing it to be run through a foreach loop. Will only allow iterator() to be called a single time - this is intended to be called inline.

## Constructor Summary

Constructors
Constructor
Description
`IterableAdapter(Iterator<T> theIterator)`

## Method Summary

Modifier and Type
Method
Description
`Iterator<T>`
`iterator()`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface Iterable

`forEach, spliterator`

## Constructor Details

### IterableAdapter

public IterableAdapter(Iterator<T> theIterator)

## Method Details

### iterator

public Iterator<T> iterator()

Specified by:
  `iterator` in interface `Iterable<T>`