|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gersteinlab.act.data.Interval
public class Interval
This class defines an interval of genomic locations. Positions are 0-based, and the intervals are left-closed, right-open. In other words, if a sequence contains n locations, the whole interval is represented as [0, n).
Field Summary | |
---|---|
static char |
ANY_STRAND
The official symbol to indicate that the strand is not important. |
protected java.util.Map<java.lang.String,java.lang.String> |
attributes
Additional attributes of the interval. |
protected double |
doubleValue
The double value of the interval. |
protected long |
end
The ending position of the interval, 0-based, not included. |
static char |
MINUS_STRAND
The official symbol for the minus strand. |
static char |
PLUS_STRAND
The official symbol for the plus strand. |
protected long |
start
The starting position of the interval, 0-based, included. |
protected char |
strand
The strand of the interval. |
Constructor Summary | |
---|---|
Interval()
Create a dummy interval. |
|
Interval(java.lang.String chrIn,
long startIn,
long endIn)
Create an interval. |
|
Interval(java.lang.String chrIn,
long startIn,
long endIn,
char strandIn)
Create an interval. |
Method Summary | |
---|---|
int |
backwardCompareTo(Interval intervalIn)
Compare this interval with an input interval based on backward ordering. |
int |
compareTo(Interval intervalIn)
Compare this interval with an input interval based on natural ordering. |
boolean |
equals(java.lang.Object o)
Check if this interval is semantically equivalent to an input object. |
int |
forwardCompareTo(Interval intervalIn)
Compare this interval with an input interval based on forward ordering. |
java.lang.String |
getAttribute(java.lang.String attrName)
Get the value of an attribute. |
java.lang.String |
getChr()
Get the chromosome of the interval. |
double |
getDoubleValue()
Get the double value of the interval. |
long |
getEnd()
Get the ending position of the interval. |
long |
getLength()
Get the length of the interval. |
long |
getStart()
Get the starting position of the interval. |
long |
getStrand()
Get the strand of the interval. |
int |
hashCode()
Get the hash code of this interval. |
boolean |
intersects(Interval intervalIn)
Check if this interval intersects with an input interval. |
void |
setAttribute(java.lang.String attrName,
java.lang.String attrValue)
Set the value of an attribute. |
void |
setChr(java.lang.String chrIn)
Set the chromosome of the interval. |
void |
setDoubleValue(double doubleValueIn)
Set the double value of the interval. |
void |
setEnd(long endIn)
Set the ending position of the interval. |
void |
setStart(long startIn)
Set the starting position of the interval. |
void |
setStrand(char strandIn)
Set the strand of the interval. |
java.lang.String |
toString()
Get a string representation of the interval. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final char PLUS_STRAND
public static final char MINUS_STRAND
public static final char ANY_STRAND
protected long start
protected long end
protected char strand
protected double doubleValue
protected java.util.Map<java.lang.String,java.lang.String> attributes
Constructor Detail |
---|
public Interval()
public Interval(java.lang.String chrIn, long startIn, long endIn)
chrIn
- Chromosome of the intervalstartIn
- The starting position of the interval, 0-based, includedendIn
- The ending position of the interval, 0-based, not includedpublic Interval(java.lang.String chrIn, long startIn, long endIn, char strandIn)
chrIn
- Chromosome of the intervalstartIn
- The starting position of the interval, 0-based, includedendIn
- The ending position of the interval, 0-based, not includedstrandIn
- The strandMethod Detail |
---|
public java.lang.String getChr()
public long getStart()
public long getEnd()
public long getStrand()
public double getDoubleValue()
public java.lang.String getAttribute(java.lang.String attrName)
attrName
- Name of the attribute
public void setChr(java.lang.String chrIn)
chrIn
- The chromosome of the intervalpublic void setStart(long startIn)
startIn
- The starting position of the interval, 0-based, includedpublic void setEnd(long endIn)
endIn
- The ending position of the interval, 0-based, not includedpublic void setStrand(char strandIn)
strandIn
- The strandpublic void setDoubleValue(double doubleValueIn)
doubleValueIn
- The valuepublic void setAttribute(java.lang.String attrName, java.lang.String attrValue)
attrName
- Name of the attributeattrValue
- Value of the attributepublic long getLength()
public int compareTo(Interval intervalIn)
compareTo
in interface java.lang.Comparable<Interval>
intervalIn
- The input interval
public int forwardCompareTo(Interval intervalIn)
intervalIn
- The input interval
public int backwardCompareTo(Interval intervalIn)
intervalIn
- The input interval
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- The input object
public int hashCode()
hashCode
in class java.lang.Object
public boolean intersects(Interval intervalIn)
intervalIn
- The input interval
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |