E
- the type of elements in this windowpublic class Window<E extends GTRec>
extends java.lang.Object
Window
represents a window of VCF recList.Constructor | Description |
---|---|
Window(java.util.List<E> recList,
int overlapEnd,
int overlapStart,
boolean lastWindowOnChrom,
boolean lastWindow) |
Constructs a new
Window instance from the specified data. |
Modifier and Type | Method | Description |
---|---|---|
void |
addRecords(java.util.List<E> list,
int start,
int end) |
Adds the specified records to he specified list.
|
int |
chromIndex() |
Returns the chromosome index of the first maker in the window.
|
boolean |
lastWindow() |
Returns
true if the sliding window of genotype records is the
last window and returns false otherwise. |
boolean |
lastWindowOnChrom() |
Returns
true if the sliding window of genotype records is the
last window for its chromosome and returns false otherwise. |
int |
nMarkers() |
Returns the number of markers in this window.
|
int |
overlapEnd() |
Returns the index of the first marker after the overlap with the
preceding marker window.
|
int |
overlapStart() |
Returns the index of the first marker in the overlap with the
next marker window.
|
E |
rec(int marker) |
Returns the specified record.
|
java.util.List<E> |
recList() |
Returns the list of recList in this window.
|
public Window(java.util.List<E> recList, int overlapEnd, int overlapStart, boolean lastWindowOnChrom, boolean lastWindow)
Window
instance from the specified data.
The contract for the constructed instance is undefined if any element
of the specified recList
is null
.recList
- a list of marker recListoverlapEnd
- the index of the first marker after the overlap with
the preceding marker windowoverlapStart
- the index of the first marker in the overlap with the
next marker windowlastWindowOnChrom
- true
if the sliding window of
VCF Records is the last window for its chromosomelastWindow
- true
if the sliding window of
VCF Records is the last windowjava.lang.IllegalArgumentException
- if recList.isEmpty()
java.lang.IllegalArgumentException
- if
lastWindowOnChrom && overlapStart != recList.size()
java.lang.NullPointerException
- if recList==null
public int nMarkers()
public java.util.List<E> recList()
public E rec(int marker)
marker
- a marker indexjava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nMarkers()
public void addRecords(java.util.List<E> list, int start, int end)
list
- the list to be added tostart
- the start record index (inclusive)end
- the end record index (exclusive)java.lang.IndexOutOfBoundsException
- if
start < 0 || end > this.nMarkers() || start > end
java.lang.NullPointerException
- if list == null
public int overlapEnd()
public int overlapStart()
this.size()
if the next marker
window does not exist or is from a different chromosome.public int chromIndex()
public boolean lastWindowOnChrom()
true
if the sliding window of genotype records is the
last window for its chromosome and returns false
otherwise.true
if the sliding window of genotype records is the
last window for its chromosomepublic boolean lastWindow()
true
if the sliding window of genotype records is the
last window and returns false
otherwise.true
if the sliding window of genotype records is the
last window