Package org.biojavax.bio.seq
Class SimplePosition
- java.lang.Object
- 
- org.biojavax.bio.seq.SimplePosition
 
- 
- All Implemented Interfaces:
- Position
 
 public class SimplePosition extends Object implements Position A simple implementation of the Position interface.- Since:
- 1.5
- Author:
- Richard Holland
 
- 
- 
Field Summary- 
Fields inherited from interface org.biojavax.bio.seq.PositionBETWEEN_BASES, EMPTY_POSITION, IN_RANGE
 
- 
 - 
Constructor SummaryConstructors Modifier Constructor Description protectedSimplePosition()SimplePosition(boolean fs, boolean fe, int p)Constructs a point position, with optionally fuzzy start and end.SimplePosition(boolean fs, boolean fe, int s, int e, String t)Constructs a range position, with optionally fuzzy start and end.SimplePosition(int p)Constructs a point position, with no fuzzy start or end.SimplePosition(int s, int e)Constructs a range position, with no fuzzy start or end.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)Two positions are equal if they share all parameters in common, eg. fuzzy start+end, start, end, type.intgetEnd()Returns the end of the range of bases this base could lie in.booleangetFuzzyEnd()Returns true if the position has a fuzzy end.booleangetFuzzyStart()Returns true if the position has a fuzzy start.IntegergetId()Gets the Hibernate ID.intgetStart()Returns the beginning of the range of bases this base could lie in.StringgetType()Returns the type of this position if it is not a point/single position.voidsetId(Integer id)Sets the Hibernate ID.StringtoString()Positiontranslate(int distance)Takes this position and returns a copy translated by 'distance' bases.
 
- 
- 
- 
Constructor Detail- 
SimplePositionpublic SimplePosition(int p) Constructs a point position, with no fuzzy start or end. (eg. 1, 2, or 3).- Parameters:
- p- the point position
 
 - 
SimplePositionpublic SimplePosition(int s, int e) Constructs a range position, with no fuzzy start or end. (eg. 1..2, 2..5, or 3..8).- Parameters:
- s- the start position
- e- the end position
 
 - 
SimplePositionpublic SimplePosition(boolean fs, boolean fe, int p) Constructs a point position, with optionally fuzzy start and end. (eg. <1 or 3> or 2 or even <5>).- Parameters:
- fs- fuzzy start?
- fe- fuzzy end?
- p- the point position
 
 - 
SimplePositionpublic SimplePosition(boolean fs, boolean fe, int s, int e, String t) Constructs a range position, with optionally fuzzy start and end. (eg. <1.2 or 1^3> or 2.2 or even <5^6>). The type of the range is given, it should normally be one of the two defined in the Position interface, but its up to you.- Parameters:
- fs- fuzzy start?
- fe- fuzzy end?
- s- the start of the position
- e- the end of the position
- t- the type of the position
 
 - 
SimplePositionprotected SimplePosition() 
 
- 
 - 
Method Detail- 
getFuzzyStartpublic boolean getFuzzyStart() Returns true if the position has a fuzzy start.- Specified by:
- getFuzzyStartin interface- Position
- Returns:
- the fuzziness of the start.
 
 - 
getFuzzyEndpublic boolean getFuzzyEnd() Returns true if the position has a fuzzy end.- Specified by:
- getFuzzyEndin interface- Position
- Returns:
- the fuzziness of the end.
 
 - 
getStartpublic int getStart() Returns the beginning of the range of bases this base could lie in. If this position is a single position, then start=end.
 - 
getEndpublic int getEnd() Returns the end of the range of bases this base could lie in. If this position is a single position, then start=end.
 - 
getTypepublic String getType() Returns the type of this position if it is not a point/single position. Types are usually BETWEEN_BASES or IN_RANGE but could be any string value.
 - 
translatepublic Position translate(int distance) Takes this position and returns a copy translated by 'distance' bases.
 - 
equalspublic boolean equals(Object o) Two positions are equal if they share all parameters in common, eg. fuzzy start+end, start, end, type.
 - 
getIdpublic Integer getId() Gets the Hibernate ID. Should be used with caution.- Returns:
- the Hibernate ID, if using Hibernate.
 
 
- 
 
-