|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.symbol.AbstractLocation
org.biojava.bio.symbol.AbstractRangeLocation
org.biojava.bio.symbol.FuzzyLocation
public class FuzzyLocation
A 'fuzzy' location a-la Embl fuzzy locations.
Fuzzy locations have propreties that indicate that they may start before min and end after max. However, this in no way affects how they interact with other locations.
Nested Class Summary | |
---|---|
static interface |
FuzzyLocation.RangeResolver
Determines how a FuzzyLocation should be treated when used
as a normal Location . |
Field Summary | |
---|---|
static FuzzyLocation.RangeResolver |
RESOLVE_AVERAGE
Use the arithmetic mean of the `inner' and `outer' values, unless the outer value is unbounded. |
static FuzzyLocation.RangeResolver |
RESOLVE_INNER
Always use the `inner' values. |
static FuzzyLocation.RangeResolver |
RESOLVE_OUTER
Use the `outer' values, unless they are unbounded in which case the `inner' values are used. |
Fields inherited from interface org.biojava.bio.symbol.Location |
---|
empty, full, naturalOrder |
Constructor Summary | |
---|---|
FuzzyLocation(int outerMin,
int outerMax,
int innerMin,
int innerMax,
boolean isMinFuzzy,
boolean isMaxFuzzy,
FuzzyLocation.RangeResolver resolver)
Create a new FuzzyLocation with endpoints (outerMin.innerMin) and (innerMax.outerMax). |
|
FuzzyLocation(int outerMin,
int outerMax,
int innerMin,
int innerMax,
FuzzyLocation.RangeResolver resolver)
Create a new FuzzyLocation with endpoints (outerMin.innerMin) and (innerMax.outerMax). |
Method Summary | |
---|---|
int |
getInnerMax()
|
int |
getInnerMin()
|
int |
getMax()
The maximum position contained. |
int |
getMin()
The minimum position contained. |
int |
getOuterMax()
|
int |
getOuterMin()
|
FuzzyLocation.RangeResolver |
getResolver()
Retrieve the Location that this decorates. |
boolean |
hasBoundedMax()
|
boolean |
hasBoundedMin()
|
protected void |
initializeVariables(int outerMin,
int outerMax,
int innerMin,
int innerMax,
boolean isMinFuzzy,
boolean isMaxFuzzy,
FuzzyLocation.RangeResolver resolver)
Refactored initialization code from the constructors. |
boolean |
isMaxFuzzy()
|
boolean |
isMinFuzzy()
|
String |
toString()
|
Location |
translate(int dist)
Create a location that is a translation of this location. |
Methods inherited from class org.biojava.bio.symbol.AbstractRangeLocation |
---|
blockIterator, contains, isContiguous, symbols |
Methods inherited from class org.biojava.bio.symbol.AbstractLocation |
---|
contains, equals, getDecorator, hashCode, intersection, newInstance, overlaps, union |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final FuzzyLocation.RangeResolver RESOLVE_INNER
public static final FuzzyLocation.RangeResolver RESOLVE_OUTER
public static final FuzzyLocation.RangeResolver RESOLVE_AVERAGE
Constructor Detail |
---|
public FuzzyLocation(int outerMin, int outerMax, int innerMin, int innerMax, FuzzyLocation.RangeResolver resolver)
outerMin
- the lower bound on the location's min value.
Integer.MIN_VALUE indicates unbounded.outerMax
- the upper bound on the location's max value.
Integer.MAX_VALUE indicates unbounded.innerMin
- the upper bound on the location's min value.innerMax
- the lower bound on the location's max value.resolver
- a RangeResolver object which defines the policy used to calculate
the location's min and max properties.public FuzzyLocation(int outerMin, int outerMax, int innerMin, int innerMax, boolean isMinFuzzy, boolean isMaxFuzzy, FuzzyLocation.RangeResolver resolver)
Note that it is not logical to specify inner and outer values that
clearly denote fuzzy boundaries and the set the isMinFuzzy
or
isMaxFuzzy
value to false. This object makes
no specific check of your logic so be careful.
outerMin
- the lower bound on the location's min value.
Integer.MIN_VALUE indicates unbounded.outerMax
- the upper bound on the location's max value.
Integer.MAX_VALUE indicates unbounded.innerMin
- the upper bound on the location's min value.innerMax
- the lower bound on the location's max value.isMinFuzzy
- Explictly state if the minimum is fuzzyisMaxFuzzy
- Explictly state if the maximum is fuzzyresolver
- a RangeResolver object which defines the policy used to
calculate the location's min and max properties.Method Detail |
---|
public Location translate(int dist)
Location
translate
in interface Location
dist
- the distance to translate (to the right)public FuzzyLocation.RangeResolver getResolver()
public int getOuterMin()
public int getOuterMax()
public int getInnerMin()
public int getInnerMax()
public int getMin()
Location
WARNING: The location will not contain every point between getMin()
and getMax()
if isContiguous()
is false. If isContiguous()
does return false you should use the Iterator
returned by blockIterator()
to iterate over the minimum set of contiguous blocks that make up this Location
getMin
in interface Location
public int getMax()
Location
WARNING: The location will not contain every point between getMin()
and getMax()
if isContiguous()
is false. If isContiguous()
does return false you should use the Iterator
returned by blockIterator()
to iterate over the minimum set of contiguous blocks that make up this Location
getMax
in interface Location
public boolean hasBoundedMin()
public boolean hasBoundedMax()
public String toString()
toString
in class Object
public boolean isMinFuzzy()
public boolean isMaxFuzzy()
protected void initializeVariables(int outerMin, int outerMax, int innerMin, int innerMax, boolean isMinFuzzy, boolean isMaxFuzzy, FuzzyLocation.RangeResolver resolver)
outerMin
- the lower bound on the location's min value.
Integer.MIN_VALUE indicates unbounded.outerMax
- the upper bound on the location's max value.
Integer.MAX_VALUE indicates unbounded.innerMin
- the upper bound on the location's min value.innerMax
- the lower bound on the location's max value.resolver
- a RangeResolver object which defines the policy used to calculate
the location's min and max properties.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |