public class HapsMarkerIterator extends java.lang.Object implements FileIt<HapsMarker>
Class HapsMarkerIterator
represents a file iterator whose
next()
method returns HapsMarker
objects.
Instances of class HapsMarkerIterator
are not thread-safe.
Constructor and Description |
---|
HapsMarkerIterator(HapPairs haps)
Constructs a new
HapsMarkerIterator instance that iterates
through the markers of the specified HapPairs object. |
Modifier and Type | Method and Description |
---|---|
void |
close()
Terminates the iteration and releases any system resources that
are held by this object.
|
java.io.File |
file()
Returns the file from which the data are read, or
null if the data are read from standard input or are
computed data. |
boolean |
hasNext()
Returns
true if the iteration has more elements, and returns
false otherwise. |
HapsMarker |
next()
Returns the next element in the iteration.
|
void |
remove()
The
remove method is not supported by this iterator. |
public HapsMarkerIterator(HapPairs haps)
HapsMarkerIterator
instance that iterates
through the markers of the specified HapPairs
object.haps
- the haplotype pairsjava.lang.NullPointerException
- if haps == null
public java.io.File file()
FileIt
null
if the data are read from standard input or are
computed data.file
in interface FileIt<HapsMarker>
null
if the data are read from standard input or are
computed datapublic void close()
FileIt
close
, further
invocations of close()
have no effect.close
in interface FileIt<HapsMarker>
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public boolean hasNext()
true
if the iteration has more elements, and returns
false
otherwise.hasNext
in interface java.util.Iterator<HapsMarker>
true
if the iteration has more elementspublic HapsMarker next()
next
in interface java.util.Iterator<HapsMarker>
java.util.NoSuchElementException
- if the iteration has no more elementspublic void remove()
remove
method is not supported by this iterator.remove
in interface java.util.Iterator<HapsMarker>
java.lang.UnsupportedOperationException
- if this method is invoked