Class FuzzyLocation
- All Implemented Interfaces:
Serializable
,Location
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.
- Author:
- Matthew Pocock, Thomas Down, Greg Cox
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Determines how aFuzzyLocation
should be treated when used as a normalLocation
. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FuzzyLocation.RangeResolver
Use the arithmetic mean of the `inner' and `outer' values, unless the outer value is unbounded.static final FuzzyLocation.RangeResolver
Always use the `inner' values.static final FuzzyLocation.RangeResolver
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
ConstructorsConstructorDescriptionFuzzyLocation
(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
Modifier and TypeMethodDescriptionint
int
int
getMax()
The maximum position contained.int
getMin()
The minimum position contained.int
int
Retrieve the Location that this decorates.boolean
boolean
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
boolean
toString()
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
-
Field Details
-
RESOLVE_INNER
Always use the `inner' values. -
RESOLVE_OUTER
Use the `outer' values, unless they are unbounded in which case the `inner' values are used. -
RESOLVE_AVERAGE
Use the arithmetic mean of the `inner' and `outer' values, unless the outer value is unbounded.
-
-
Constructor Details
-
FuzzyLocation
public FuzzyLocation(int outerMin, int outerMax, int innerMin, int innerMax, FuzzyLocation.RangeResolver resolver) Create a new FuzzyLocation with endpoints (outerMin.innerMin) and (innerMax.outerMax).- Parameters:
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.
-
FuzzyLocation
public 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). This constructor allows you to explicitly mark an endpoint as fuzzy, even if there is no other information about it. For example, a valid swissprot location "?5 10" would be a fuzzy location 5 to 10 where the min is fuzzy and the max is not.Note that it is not logical to specify inner and outer values that clearly denote fuzzy boundaries and the set the
isMinFuzzy
orisMaxFuzzy
value to false. This object makes no specific check of your logic so be careful.- Parameters:
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 Details
-
translate
Description copied from interface:Location
Create a location that is a translation of this location. -
getResolver
Retrieve the Location that this decorates.- Returns:
- the Location instance that stores all of the Location interface data
-
getOuterMin
-
getOuterMax
-
getInnerMin
-
getInnerMax
-
getMin
Description copied from interface:Location
The minimum position contained.WARNING: The location will not contain every point between
getMin()
andgetMax()
ifisContiguous()
is false. IfisContiguous()
does return false you should use theIterator
returned byblockIterator()
to iterate over the minimum set of contiguous blocks that make up thisLocation
-
getMax
Description copied from interface:Location
The maximum position contained.WARNING: The location will not contain every point between
getMin()
andgetMax()
ifisContiguous()
is false. IfisContiguous()
does return false you should use theIterator
returned byblockIterator()
to iterate over the minimum set of contiguous blocks that make up thisLocation
-
hasBoundedMin
-
hasBoundedMax
-
toString
-
isMinFuzzy
-
isMaxFuzzy
-
initializeVariables
protected void initializeVariables(int outerMin, int outerMax, int innerMin, int innerMax, boolean isMinFuzzy, boolean isMaxFuzzy, FuzzyLocation.RangeResolver resolver) Refactored initialization code from the constructors.- Parameters:
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.
-