Class SimplePoint

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Point>, Point
    Direct Known Subclasses:
    FuzzyPoint

    public class SimplePoint
    extends java.lang.Object
    implements java.io.Serializable, Point
    Basic implementation of the Point interface.
    Author:
    ayates
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.biojava.nbio.core.sequence.location.template.Point

        Point.Resolver<T extends Point>
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected SimplePoint()  
        SimplePoint​(int position)  
        SimplePoint​(int position, boolean unknown, boolean uncertain)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Point clonePoint()
      Returns a copy of this point
      int compareTo​(Point o)  
      boolean equals​(java.lang.Object obj)  
      java.lang.Integer getPosition()
      Returns the position held by this object
      int hashCode()  
      boolean isHigher​(Point point)
      Returns true if the point is higher in value to the current point
      boolean isLower​(Point point)
      Returns true if the current point is at a lower position than the point given.
      boolean isUncertain()
      Returns a true if the exact point is unknown.
      boolean isUnknown()
      Returns true if the current position is unknown but is beyond the position encoded for.
      Point offset​(int distance)
      Returns a new point offset by the given distance
      Point reverse​(int length)
      Returns the equivalent position on the reverse strand
      protected int reverse​(int position, int length)  
      protected void setPosition​(int position)  
      protected void setUncertain​(boolean uncertain)  
      protected void setUnknown​(boolean unknown)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SimplePoint

        protected SimplePoint()
      • SimplePoint

        public SimplePoint​(int position)
      • SimplePoint

        public SimplePoint​(int position,
                           boolean unknown,
                           boolean uncertain)
    • Method Detail

      • getPosition

        public java.lang.Integer getPosition()
        Description copied from interface: Point
        Returns the position held by this object
        Specified by:
        getPosition in interface Point
      • setPosition

        protected void setPosition​(int position)
      • isUnknown

        public boolean isUnknown()
        Description copied from interface: Point
        Returns true if the current position is unknown but is beyond the position encoded for. This is the same as the position
        >80
        as encoded by UniProt.
        Specified by:
        isUnknown in interface Point
      • setUnknown

        protected void setUnknown​(boolean unknown)
      • isUncertain

        public boolean isUncertain()
        Description copied from interface: Point
        Returns a true if the exact point is unknown. Equivalent position from UniProt is
        ?80
        .
        Specified by:
        isUncertain in interface Point
      • setUncertain

        protected void setUncertain​(boolean uncertain)
      • reverse

        public Point reverse​(int length)
        Description copied from interface: Point
        Returns the equivalent position on the reverse strand
        Specified by:
        reverse in interface Point
        Parameters:
        length - Length of the sequence to translate to
      • offset

        public Point offset​(int distance)
        Description copied from interface: Point
        Returns a new point offset by the given distance
        Specified by:
        offset in interface Point
      • reverse

        protected int reverse​(int position,
                              int length)
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(Point o)
        Specified by:
        compareTo in interface java.lang.Comparable<Point>
      • isLower

        public boolean isLower​(Point point)
        Description copied from interface: Point
        Returns true if the current point is at a lower position than the point given.
        Specified by:
        isLower in interface Point
      • isHigher

        public boolean isHigher​(Point point)
        Description copied from interface: Point
        Returns true if the point is higher in value to the current point
        Specified by:
        isHigher in interface Point
      • clonePoint

        public Point clonePoint()
        Description copied from interface: Point
        Returns a copy of this point
        Specified by:
        clonePoint in interface Point