Interface Position

All Known Implementing Classes:
SimplePosition

public interface Position
Holds info about base positions.
Since:
1.5
Author:
Richard Holland
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    A symbol representing a position that falls in between two bases, eg. 2^3 falls somewhere in the gap between 2 and 3.
    static final Position
    The empty position lies nowhere.
    static final String
    A symbol representing a position that occupies a single base somewhere in a range, eg. 5.10 falls on some base between 5 and 10.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the end of the range of bases this base could lie in.
    boolean
    Returns true if the position has a fuzzy end.
    boolean
    Returns true if the position has a fuzzy start.
    int
    Returns the beginning of the range of bases this base could lie in.
    Returns the type of this position if it is not a point/single position.
    translate(int distance)
    Takes this position and returns a copy translated by 'distance' bases.
  • Field Details

    • EMPTY_POSITION

      static final Position EMPTY_POSITION
      The empty position lies nowhere.
    • BETWEEN_BASES

      static final String BETWEEN_BASES
      A symbol representing a position that falls in between two bases, eg. 2^3 falls somewhere in the gap between 2 and 3.
      See Also:
    • IN_RANGE

      static final String IN_RANGE
      A symbol representing a position that occupies a single base somewhere in a range, eg. 5.10 falls on some base between 5 and 10.
      See Also:
  • Method Details

    • getFuzzyStart

      boolean getFuzzyStart()
      Returns true if the position has a fuzzy start.
      Returns:
      the fuzziness of the start.
    • getFuzzyEnd

      boolean getFuzzyEnd()
      Returns true if the position has a fuzzy end.
      Returns:
      the fuzziness of the end.
    • getStart

      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.
      Returns:
      the start of this position.
    • getEnd

      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.
      Returns:
      the end of this position.
    • translate

      Position translate(int distance)
      Takes this position and returns a copy translated by 'distance' bases.
      Parameters:
      distance - the distance to translate it.
      Returns:
      the translated position.
    • 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.
      Returns:
      the type of this position.