automatically adding @Override annotations #729

Merged
merged 1 commit into from Feb 21, 2017
Jump to file or symbol
Failed to load files and symbols.
+583 −2
Split
@@ -88,6 +88,7 @@ protected AbstractBAMFileIndex(final File file, final SAMSequenceDictionary dict
/**
* Close this index and release any associated resources.
*/
+ @Override
public void close() {
mIndexBuffer.close();
}
@@ -170,6 +171,7 @@ public int getNumberOfReferences() {
* @return The file offset of the first record in the last linear bin, or -1
* if there are no elements in linear bins (i.e. no mapped reads).
*/
+ @Override
public long getStartOfLastLinearBin() {
seek(4);
@@ -206,6 +208,7 @@ public long getStartOfLastLinearBin() {
* @param reference the reference of interest
* @return meta data for the reference
*/
+ @Override
public BAMIndexMetaData getMetaData(final int reference) {
seek(4);
@@ -48,11 +48,13 @@ public void setProgressLogger(final ProgressLoggerInterface progress) {
* Adds an alignment to the queue to be written. Will re-throw any exception that was received when
* writing prior record(s) to the underlying SAMFileWriter.
*/
+ @Override
public void addAlignment(final SAMRecord alignment) {
write(alignment);
}
/** Returns the SAMFileHeader from the underlying SAMFileWriter. */
+ @Override
public SAMFileHeader getFileHeader() {
return this.underlyingWriter.getFileHeader();
}
@@ -341,6 +341,7 @@ static long findVirtualOffsetOfFirstRecord(final File bam) throws IOException {
* If true, writes the source of every read into the source SAMRecords.
* @param enabled true to write source information into each SAMRecord.
*/
+ @Override
void enableFileSource(final SamReader reader, final boolean enabled) {
this.mReader = enabled ? reader : null;
}
@@ -349,6 +350,7 @@ void enableFileSource(final SamReader reader, final boolean enabled) {
* If true, uses the caching version of the index reader.
* @param enabled true to use the caching version of the reader.
*/
+ @Override
protected void enableIndexCaching(final boolean enabled) {
if(mIndex != null)
throw new SAMException("Unable to turn on index caching; index file has already been loaded.");
@@ -360,6 +362,7 @@ protected void enableIndexCaching(final boolean enabled) {
* This is slower but more scalable when accessing large numbers of BAM files sequentially.
* @param enabled True to use memory mapping, false to use regular I/O.
*/
+ @Override
protected void enableIndexMemoryMapping(final boolean enabled) {
if (mIndex != null) {
throw new SAMException("Unable to change index memory mapping; index file has already been loaded.");
@@ -381,6 +384,7 @@ protected void enableIndexMemoryMapping(final boolean enabled) {
/**
* @return true if ths is a BAM file, and has an index
*/
+ @Override
public boolean hasIndex() {
return mIsSeekable && ((mIndexFile != null) || (mIndexStream != null));
}
@@ -389,6 +393,7 @@ public boolean hasIndex() {
* Retrieves the index for the given file type. Ensure that the index is of the specified type.
* @return An index of the given type.
*/
+ @Override
public BAMIndex getIndex() {
if(!hasIndex())
throw new SAMException("No index is available for this BAM file.");
@@ -425,17 +430,20 @@ public void close() {
mIndex = null;
}
+ @Override
public SAMFileHeader getFileHeader() {
return mFileHeader;
}
/**
* Set error-checking level for subsequent SAMRecord reads.
*/
+ @Override
void setValidationStringency(final ValidationStringency validationStringency) {
this.mValidationStringency = validationStringency;
}
+ @Override
public ValidationStringency getValidationStringency() {
return this.mValidationStringency;
}
@@ -448,6 +456,7 @@ public ValidationStringency getValidationStringency() {
* getIterator() begins its iteration where the last one left off. That is the best that can be
* done in that situation.
*/
+ @Override
public CloseableIterator<SAMRecord> getIterator() {
if (mStream == null) {
throw new IllegalStateException("File reader is closed");
@@ -552,6 +561,7 @@ public SAMFileSpan getFilePointerSpanningReads() {
* @return Iterator for the matching SAMRecords
* @see QueryInterval#optimizeIntervals(QueryInterval[])
*/
+ @Override
public CloseableIterator<SAMRecord> query(final QueryInterval[] intervals, final boolean contained) {
if (mStream == null) {
throw new IllegalStateException("File reader is closed");
@@ -582,6 +592,7 @@ public SAMFileSpan getFilePointerSpanningReads() {
* @param start Alignment start sought.
* @return Iterator for the matching SAMRecords.
*/
+ @Override
public CloseableIterator<SAMRecord> queryAlignmentStart(final String sequence, final int start) {
if (mStream == null) {
throw new IllegalStateException("File reader is closed");
@@ -608,6 +619,7 @@ public SAMFileSpan getFilePointerSpanningReads() {
*
* @return Iterator for the matching SAMRecords.
*/
+ @Override
public CloseableIterator<SAMRecord> queryUnmapped() {
if (mStream == null) {
throw new IllegalStateException("File reader is closed");
@@ -710,6 +722,7 @@ private static SAMSequenceRecord readSequenceRecord(final BinaryCodec stream, fi
private boolean isClosed = false;
+ @Override
public void close() {
if (!isClosed) {
if (mCurrentIterator != null && this != mCurrentIterator) {
@@ -724,6 +737,7 @@ protected void assertOpen() {
if (isClosed) throw new AssertionError("Iterator has been closed");
}
+ @Override
public void remove() {
throw new UnsupportedOperationException("Not supported: remove");
}
@@ -770,11 +784,13 @@ public SAMRecord next() {
}
}
+ @Override
public boolean hasNext() {
assertOpen();
return (mNextRecord != null);
}
+ @Override
public SAMRecord next() {
assertOpen();
final SAMRecord result = mNextRecord;
@@ -947,6 +963,7 @@ public static BAMFileSpan getFileSpan(QueryInterval[] intervals, BAMIndex fileIn
advance();
}
+ @Override
SAMRecord getNextRecord()
throws IOException {
// Advance to next file block if necessary
@@ -989,6 +1006,7 @@ public BAMQueryFilteringIterator(final CloseableIterator<SAMRecord> iterator,
/**
* Returns true if a next element exists; false otherwise.
*/
+ @Override
public boolean hasNext() {
assertOpen();
return mNextRecord != null;
@@ -998,6 +1016,7 @@ public boolean hasNext() {
* Gets the next record from the given iterator.
* @return The next SAM record in the iterator.
*/
+ @Override
public SAMRecord next() {
if(!hasNext())
throw new NoSuchElementException("BAMQueryFilteringIterator: no next element available");
@@ -78,6 +78,7 @@ public BAMFileSpan(final List<Chunk> chunks) {
* Does this chunk list map to any position within the BAM file?
* @return True iff the ChunkList points to any data within the BAM.
*/
+ @Override
public boolean isEmpty() {
return chunks.isEmpty();
}
@@ -86,6 +87,7 @@ public boolean isEmpty() {
* Deep clone the given chunk list.
* @return A copy of the chunk list.
*/
+ @Override
public BAMFileSpan clone() {
final BAMFileSpan clone = new BAMFileSpan();
for(final Chunk chunk: chunks)
@@ -100,6 +102,7 @@ public BAMFileSpan clone() {
* @param fileSpan The filespan before which to eliminate.
* @return A new BAMFileSpan which contains the portion of the chunk list after the given chunk.
*/
+ @Override
public SAMFileSpan removeContentsBefore(final SAMFileSpan fileSpan) {
if(fileSpan == null)
return clone();
@@ -174,6 +177,7 @@ public SAMFileSpan removeContentsAfter(final SAMFileSpan fileSpan) {
* Gets a file span over the data immediately following this span.
* @return The a pointer to data immediately following this span.
*/
+ @Override
public SAMFileSpan getContentsFollowing() {
if(chunks.isEmpty())
throw new SAMException("Unable to get the file pointer following this one: no data present.");
@@ -115,6 +115,7 @@ private BAMIndexer createBamIndex(final String path) {
}
}
+ @Override
protected void writeAlignment(final SAMRecord alignment) {
prepareToWriteAlignments();
@@ -135,10 +136,12 @@ protected void writeAlignment(final SAMRecord alignment) {
}
}
+ @Override
protected void writeHeader(final String textHeader) {
writeHeader(outputBinaryCodec, getFileHeader(), textHeader);
}
+ @Override
protected void finish() {
outputBinaryCodec.close();
try {
@@ -151,6 +154,7 @@ protected void finish() {
}
/** @return absolute path, or null if this writer does not correspond to a file. */
+ @Override
protected String getFilename() {
return outputBinaryCodec.getOutputFileName();
}
@@ -63,5 +63,6 @@
/**
* Close the index and release any associated resources.
*/
+ @Override
void close();
}
@@ -49,6 +49,7 @@
/**
* Any necessary processing at the end of the file
*/
+ @Override
public void close();
}
@@ -113,6 +113,7 @@ protected BAMRecord(final SAMFileHeader header,
/**
* Force all the lazily-initialized attributes to be decoded.
*/
+ @Override
protected void eagerDecode() {
getReadName();
getCigar();
@@ -49,13 +49,15 @@ public BAMRecordCodec(final SAMFileHeader header, final SAMRecordFactory factory
this.samRecordFactory = factory;
}
+ @Override
public BAMRecordCodec clone() {
// Do not clone the references to codecs, as they must be distinct for each instance.
return new BAMRecordCodec(this.header, this.samRecordFactory);
}
/** Sets the output stream that records will be written to. */
+ @Override
public void setOutputStream(final OutputStream os) {
this.binaryCodec.setOutputStream(os);
}
@@ -67,6 +69,7 @@ public void setOutputStream(final OutputStream os, final String filename) {
}
/** Sets the input stream that records will be read from. */
+ @Override
public void setInputStream(final InputStream is) {
this.binaryCodec.setInputStream(is);
}
@@ -85,6 +88,7 @@ public void setInputStream(final InputStream is, final String filename) {
*
* @param alignment Record to be written.
*/
+ @Override
public void encode(final SAMRecord alignment) {
// Compute block size, as it is the first element of the file representation of SAMRecord
final int readLength = alignment.getReadLength();
@@ -171,6 +175,7 @@ public void encode(final SAMRecord alignment) {
* @return null if no more records. Should throw exception if EOF is encountered in the middle of
* a record.
*/
+ @Override
public SAMRecord decode() {
int recordLength = 0;
try {
@@ -105,6 +105,7 @@ public boolean containsChunks() {
* @param other Other bin to which this bin should be compared.
* @return -1 if this < other, 0 if this == other, 1 if this > other.
*/
+ @Override
public int compareTo(final Bin other) {
if(other == null)
throw new ClassCastException("Cannot compare to a null object");
@@ -60,6 +60,7 @@ protected BinList(final int referenceSequence, final BitSet bins) {
* Gets an iterator over all selected bins.
* @return An iterator over all selected bins.
*/
+ @Override
public Iterator<Bin> iterator() {
return new BinIterator();
}
@@ -95,6 +96,7 @@ public BinIterator() {
* Are there more bins in this set, waiting to be returned?
* @return True if more bins are remaining.
*/
+ @Override
public boolean hasNext() {
return nextBin >= 0;
}
@@ -103,6 +105,7 @@ public boolean hasNext() {
* Gets the next bin in the provided BinList.
* @return the next available bin in the BinList.
*/
+ @Override
public Bin next() {
if(!hasNext())
throw new NoSuchElementException("This BinIterator is currently empty");
@@ -111,6 +114,7 @@ public Bin next() {
return new Bin(referenceSequence,currentBin);
}
+ @Override
public void remove() {
throw new UnsupportedOperationException("Unable to remove from a bin iterator");
}
@@ -78,6 +78,7 @@ public BinaryBAMIndexWriter(final int nRef, final OutputStream output) {
/**
* Write this content as binary output
*/
+ @Override
public void writeReference(final BAMIndexContent content) {
if (content == null) {
@@ -147,13 +148,15 @@ public void writeReference(final BAMIndexContent content) {
*
* @param count
*/
+ @Override
public void writeNoCoordinateRecordCount(final Long count) {
codec.writeLong(count == null ? 0 : count);
}
/**
* Any necessary processing at the end of the file
*/
+ @Override
public void close() {
codec.close();
}
Oops, something went wrong.