public class FuzzyLocation extends AbstractRangeLocation implements Serializable
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.
Modifier and Type | Class and Description |
---|---|
static interface |
FuzzyLocation.RangeResolver
Determines how a
FuzzyLocation should be treated when used
as a normal Location . |
Modifier and Type | Field and Description |
---|---|
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.
|
empty, full, naturalOrder
Constructor and Description |
---|
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).
|
Modifier and Type | Method and Description |
---|---|
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.
|
blockIterator, contains, isContiguous, symbols
contains, equals, getDecorator, hashCode, intersection, newInstance, overlaps, union
public static final FuzzyLocation.RangeResolver RESOLVE_INNER
public static final FuzzyLocation.RangeResolver RESOLVE_OUTER
public static final FuzzyLocation.RangeResolver RESOLVE_AVERAGE
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.public Location translate(int dist)
Location
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
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
public boolean hasBoundedMin()
public boolean hasBoundedMax()
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.Copyright © 2014 BioJava. All rights reserved.