org.biojava3.core.sequence.location
Class FuzzyPoint

java.lang.Object
  extended by org.biojava3.core.sequence.location.SimplePoint
      extended by org.biojava3.core.sequence.location.FuzzyPoint
All Implemented Interfaces:
Comparable<Point>, Point

public class FuzzyPoint
extends SimplePoint

Implementation for resolving fuzzy locations. Caches the calculated value.

Author:
ayates

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.biojava3.core.sequence.location.template.Point
Point.Resolver<T extends Point>
 
Field Summary
static Point.Resolver<FuzzyPoint> MAX_RESOLVER
          Always uses the max point to resolve a location
static Point.Resolver<FuzzyPoint> MEAN_RESOLVER
          Combines min and max and then gets the mean of it
static Point.Resolver<FuzzyPoint> MIN_RESOLVER
          Always uses the min point to resolve a location
 
Constructor Summary
FuzzyPoint(int minPoint, int maxPoint)
           
FuzzyPoint(int minPoint, int maxPoint, Point.Resolver<FuzzyPoint> resolver)
           
FuzzyPoint(int minPoint, int maxPoint, Point.Resolver<FuzzyPoint> resolver, boolean unknown, boolean uncertain)
           
 
Method Summary
 int compareTo(Point point)
           
 boolean equals(Object obj)
           
protected  Integer getMax()
           
protected  Integer getMin()
           
 Integer getPosition()
          Returns the position held by this object
protected  Point.Resolver<FuzzyPoint> getResolver()
           
 int hashCode()
           
 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
 
Methods inherited from class org.biojava3.core.sequence.location.SimplePoint
clonePoint, isHigher, isLower, isUncertain, isUnknown, reverse, setPosition, setUncertain, setUnknown, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MIN_RESOLVER

public static final Point.Resolver<FuzzyPoint> MIN_RESOLVER
Always uses the min point to resolve a location


MAX_RESOLVER

public static final Point.Resolver<FuzzyPoint> MAX_RESOLVER
Always uses the max point to resolve a location


MEAN_RESOLVER

public static final Point.Resolver<FuzzyPoint> MEAN_RESOLVER
Combines min and max and then gets the mean of it

Constructor Detail

FuzzyPoint

public FuzzyPoint(int minPoint,
                  int maxPoint)

FuzzyPoint

public FuzzyPoint(int minPoint,
                  int maxPoint,
                  Point.Resolver<FuzzyPoint> resolver)

FuzzyPoint

public FuzzyPoint(int minPoint,
                  int maxPoint,
                  Point.Resolver<FuzzyPoint> resolver,
                  boolean unknown,
                  boolean uncertain)
Method Detail

getPosition

public Integer getPosition()
Description copied from interface: Point
Returns the position held by this object

Specified by:
getPosition in interface Point
Overrides:
getPosition in class SimplePoint

getMax

protected Integer getMax()

getMin

protected Integer getMin()

getResolver

protected Point.Resolver<FuzzyPoint> getResolver()

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
Overrides:
reverse in class SimplePoint
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
Overrides:
offset in class SimplePoint

equals

public boolean equals(Object obj)
Overrides:
equals in class SimplePoint

hashCode

public int hashCode()
Overrides:
hashCode in class SimplePoint

compareTo

public int compareTo(Point point)
Specified by:
compareTo in interface Comparable<Point>
Overrides:
compareTo in class SimplePoint