code cleanup and containsStartPosition function

git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1919 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
depristo 2009-10-27 21:53:40 +00:00
parent 186a8dd698
commit ef2ea79994
1 changed files with 11 additions and 4 deletions

View File

@ -1,10 +1,10 @@
package org.broadinstitute.sting.utils;
import net.sf.samtools.SAMRecord;
import org.apache.log4j.Logger;
import java.util.ArrayList;
import java.util.List;
import java.io.Serializable;
/**
* Created by IntelliJ IDEA.
@ -16,9 +16,7 @@ import java.util.List;
*
*
*/
public class GenomeLoc implements Comparable<GenomeLoc>, Cloneable {
private static Logger logger = Logger.getLogger(GenomeLoc.class);
public class GenomeLoc implements Comparable<GenomeLoc>, Cloneable, Serializable {
/**
* the basic components of a genome loc, its contig index,
* start and stop position, and (optionally) the contig name
@ -178,6 +176,15 @@ public class GenomeLoc implements Comparable<GenomeLoc>, Cloneable {
return onSameContig(that) && getStart() <= that.getStart() && getStop() >= that.getStop();
}
/**
* Returns true if this GenomeLoc contains the start position of GenomeLoc that, on the same contig
* @param start
* @return
*/
public final boolean containsStartPosition(long start) {
return getStart() <= start && start <= getStop();
}
public final boolean onSameContig(GenomeLoc that) {
return (this.contigIndex == that.contigIndex);
}