public final class BrefIt extends java.lang.Object implements SampleFileIt<VcfEmission>
Class BrefIt
represents an iterator whose next()
method returns an object storing data from a VCF record with phased,
non-missing genotypes.
Instances of class BrefIt
are not thread-safe.
Methods of this class will terminate the Java Virtual Machine with an error message if an I/O error or file format error is detected.
Constructor and Description |
---|
BrefIt(java.io.File brefFile)
Constructs a new
BrefIt instance. |
BrefIt(java.io.File brefFile,
Filter<Marker> markerFilter)
Constructs a new
BrefIt instance. |
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. |
VcfEmission |
next()
Returns the next element in the iteration.
|
void |
remove()
The
remove method is not supported by this iterator. |
Samples |
samples()
Returns the list of samples.
|
java.lang.String |
toString()
Returns a string representation of
this . |
public BrefIt(java.io.File brefFile)
BrefIt
instance.brefFile
- a bref filejava.lang.IllegalArgumentException
- if a format error is detected in a
line of the specified bref filejava.lang.NullPointerException
- if file == null
public BrefIt(java.io.File brefFile, Filter<Marker> markerFilter)
BrefIt
instance.brefFile
- a bref filemarkerFilter
- a marker filter or null
java.lang.IllegalArgumentException
- if a format error is detected in a
line of the specified bref filejava.lang.NullPointerException
- if file == null
public boolean hasNext()
true
if the iteration has more elements, and returns
false
otherwise.hasNext
in interface java.util.Iterator<VcfEmission>
true
if the iteration has more elementspublic VcfEmission next()
next
in interface java.util.Iterator<VcfEmission>
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<VcfEmission>
java.lang.UnsupportedOperationException
- if this method is invokedpublic void close()
FileIt
close
, further
invocations of close()
have no effect.close
in interface FileIt<VcfEmission>
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
public java.io.File file()
FileIt
null
if the data are read from standard input or are
computed data.file
in interface FileIt<VcfEmission>
null
if the data are read from standard input or are
computed datapublic Samples samples()
SampleFileIt
samples
in interface SampleFileIt<VcfEmission>
public java.lang.String toString()
FileIt
this
. The exact
details of the representation are unspecified and subject to change.toString
in interface FileIt<VcfEmission>
toString
in class java.lang.Object
this