public class Coordinate extends Object implements Comparable<Coordinate>, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Coordinate.Strand
Public enumeration of the two alternate Strands, FORWARD and REVERSE.
|
Constructor and Description |
---|
Coordinate()
Parameterless constructor.
|
Coordinate(Integer begin,
Integer stop)
Utility constructor that takes start and stop integer positions with
no defined Strand.
|
Coordinate(Integer begin,
Integer stop,
Coordinate.Strand _strand)
Full constructor that takes start and stop integer positions and a
specified Strand (FORWARD_STRAND, REVERSE_STRAND, otherwise NULL).
|
Coordinate(Integer begin,
Integer stop,
Integer strandID)
Utility constructor that takes start and stop integer positions and an
Integer defining the Strand to be used (FORWARD_STRAND for '+1'
and REVERSE_STRAND for '-1' - otherwise NULL).
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Coordinate o)
Implements compareTo(another Coordinate) method for the Comparable interface.
|
Boolean |
containsPoint(Integer point) |
Integer |
getEnd() |
Integer |
getLength()
Returns the length of this Coordinate - taking into consideration whether
the range spans the 'absent' Zero.
|
Coordinate |
getOverlap(Coordinate test)
Returns the overlap extent (as a Coordinate) between this Coordinate and a test Coordinate.
|
Integer |
getStart() |
Coordinate.Strand |
getStrand() |
Integer |
getStrandInt() |
Boolean |
liesWithinCoordinate(Coordinate test)
Tests whether this Coordinate lies TOTALLY within the range of another test Coordinate.
|
Boolean |
overlaps(Coordinate test)
Returns whether this Coordinate overlaps with the extent of a test Coordinate.
|
void |
setEnd(Integer e)
public setter for the End of the Coordinate, will swap start and end if new end is less than start.
|
void |
setStart(Integer b)
public setter for the start of the Coordinate, will swap start and end if new start is more than the end.
|
void |
setStrand(Coordinate.Strand s) |
void |
setStrandInt(Integer s)
Utility method to set the Strand using an Integer (FORWARD_STRAND for '+1'
and REVERSE_STRAND for '-1' - otherwise NULL).
|
void |
setValues(Integer b,
Integer e)
public setter for the start and end of the Coordinate, will swap start and end if end is less than start.
|
String |
toShortString()
Returns String representation in format '1 - 2345' etc.
|
String |
toString()
Returns String representation in of format '1 - 5987 REVERSE_STRAND', '1 - 5987 FORWARD_STRAND', '1 - 5987 UNSPECIFIED_STRAND' etc.
|
public Coordinate()
public Coordinate(Integer begin, Integer stop)
begin
- stop
- public Coordinate(Integer begin, Integer stop, Integer strandID)
begin
- stop
- strandID
- public Coordinate(Integer begin, Integer stop, Coordinate.Strand _strand)
begin
- stop
- _strand
- public String toString()
public String toShortString()
public Coordinate.Strand getStrand()
public void setStart(Integer b) throws IllegalArgumentException
b
- IllegalArgumentException
public void setEnd(Integer e) throws IllegalArgumentException
e
- IllegalArgumentException
public void setValues(Integer b, Integer e)
b
- e
- public void setStrand(Coordinate.Strand s)
public void setStrandInt(Integer s)
s
- public Integer getStrandInt()
public Integer getLength()
public int compareTo(Coordinate o)
compareTo
in interface Comparable<Coordinate>
o
- the compared other Coordinatepublic Boolean liesWithinCoordinate(Coordinate test)
test
- public Boolean overlaps(Coordinate test)
test
- public Coordinate getOverlap(Coordinate test)
test
- public Boolean containsPoint(Integer point)
JEnsembl: A Java API for Ensembl Data Access v1.78
© Roslin Institute 2010-14. GNU General Public License, version3