Package htsjdk.samtools
Class Chunk
- java.lang.Object
-
- htsjdk.samtools.Chunk
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Chunk>
public class Chunk extends Object implements Cloneable, Serializable, Comparable<Chunk>
A [start,stop) file pointer pairing into the BAM file, stored as a BAM file index. A chunk is represented as a single 64-bit value where the high-order 48 bits point to the location of the start of a compressed BGZF block within a BGZF file and the low-order 16 bits point to a position within the decompressed data in the BGZF block. See the SAM/BAM spec for more details.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Chunk(long start, long end)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Chunk
clone()
int
compareTo(Chunk chunk)
boolean
equals(Object o)
long
getChunkEnd()
long
getChunkStart()
int
hashCode()
boolean
isAdjacentTo(Chunk other)
Returns whether two chunks overlap.static List<Chunk>
optimizeChunkList(List<Chunk> chunks, long minimumOffset)
boolean
overlaps(Chunk other)
Returns whether two chunks overlap.protected void
setChunkEnd(long value)
protected void
setChunkStart(long value)
String
toString()
-
-
-
Method Detail
-
getChunkStart
public long getChunkStart()
-
setChunkStart
protected void setChunkStart(long value)
-
getChunkEnd
public long getChunkEnd()
-
setChunkEnd
protected void setChunkEnd(long value)
-
compareTo
public int compareTo(Chunk chunk)
- Specified by:
compareTo
in interfaceComparable<Chunk>
-
overlaps
public boolean overlaps(Chunk other)
Returns whether two chunks overlap.- Parameters:
other
- Chunk to which this should be compared.- Returns:
- True if the chunks overlap. Returns false if the two chunks abut or are disjoint.
-
isAdjacentTo
public boolean isAdjacentTo(Chunk other)
Returns whether two chunks overlap.- Parameters:
other
- Chunk to which this should be compared.- Returns:
- True if the two chunks are adjacent. Returns false if the chunks overlap or are discontinuous.
-
-