/** * Get a GATKChunk representing the "extent" of this file span, from the start of the first * chunk to the end of the last chunk.The chunks list must be sorted in order to use this method. * * @return a GATKChunk representing the extent of this file span, or a GATKChunk representing * a span of size 0 if there are no chunks */ public GATKChunk getExtent() { validateSorted(); // TODO: defensive measure: may be unnecessary List<Chunk> chunks = getChunks(); if ( chunks.isEmpty() ) { return new GATKChunk(0L, 0L); } return new GATKChunk(chunks.get(0).getChunkStart(), chunks.get(chunks.size() - 1).getChunkEnd()); }