Class FuzzyPointLocation
- All Implemented Interfaces:
Serializable,Location
FuzzyPointLocation represents two types of EMBL-style
partially-defined locations. These are the '(123.567)' type, which
represent a single residue somewhere between these coordinates and
the '<123' or '>123' type, which represent an unbounded location,
not including the residue at that coordinate.- Author:
- Keith James, Greg Cox
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceDetermines how aFuzzyPointLocationshould be treated when used as a normalLocation. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final FuzzyPointLocation.PointResolverstatic final FuzzyPointLocation.PointResolverstatic final FuzzyPointLocation.PointResolverFields inherited from interface org.biojava.bio.symbol.Location
empty, full, naturalOrder -
Constructor Summary
ConstructorsConstructorDescriptionFuzzyPointLocation(int min, int max, FuzzyPointLocation.PointResolver resolver) Creates a newFuzzyPointLocationobject. -
Method Summary
Modifier and TypeMethodDescriptionReturn an Iterator over the set of maximal contiguous sub-locations.booleancontains(int point) Checks if this location contains a point.booleanChecks if this location contains the other.booleanintgetMax()The maximum position contained.intgetMin()The minimum position contained.booleanbooleaninthashCode()intersection(Location loc) Returns a Location that contains all points common to both ranges.booleanDetermine if a Location is contiguous.booleanChecks if these two locations overlap, using this location's concept of overlapping.symbols(SymbolList slist) Return the symbols in a sequence that fall within this range.toString()translate(int dist) Create a location that is a translation of this location.Methods inherited from class org.biojava.bio.symbol.AbstractLocation
equals, getDecorator, newInstance, union
-
Field Details
-
RESOLVE_MIN
-
RESOLVE_MAX
-
RESOLVE_AVERAGE
-
-
Constructor Details
-
FuzzyPointLocation
Creates a newFuzzyPointLocationobject. If the minimum value is equal to the maximum value, it is interperted as a swissprot point location such as "?24". If the minimum is Integer.MIN_VALUE and the maximum is Integer.MAX_VALUE, it is interperted as a swissprot location like '?'.- Parameters:
min- anintvalue for the minimum boundary of the location, Integer.MIN_VALUE if unbounded.max- anintvalue for the minimum boundary of the location, Integer.MAX_VALUE if unbounded.resolver- aPointResolverwhich defines the policy used to calculate the location's min and max properties.
-
-
Method Details
-
getResolver
-
getMin
Description copied from interface:LocationThe minimum position contained.WARNING: The location will not contain every point between
getMin()andgetMax()ifisContiguous()is false. IfisContiguous()does return false you should use theIteratorreturned byblockIterator()to iterate over the minimum set of contiguous blocks that make up thisLocation- Returns:
- the minimum position contained
-
getMax
Description copied from interface:LocationThe maximum position contained.WARNING: The location will not contain every point between
getMin()andgetMax()ifisContiguous()is false. IfisContiguous()does return false you should use theIteratorreturned byblockIterator()to iterate over the minimum set of contiguous blocks that make up thisLocation- Returns:
- the maximum position contained
-
hasBoundedMin
-
hasBoundedMax
-
overlaps
Description copied from interface:LocationChecks if these two locations overlap, using this location's concept of overlapping.Abstractly, two locations overlap if they both contain any point.
- Specified by:
overlapsin interfaceLocation- Overrides:
overlapsin classAbstractLocation- Parameters:
loc- the Location to check- Returns:
- true if they overlap, otherwise false
-
contains
Description copied from interface:LocationChecks if this location contains the other.Abstractly, a location contains another if every point in the other location is contained within this one.
- Specified by:
containsin interfaceLocation- Overrides:
containsin classAbstractLocation- Parameters:
loc- the Location to check- Returns:
- true if this contains l, otherwise false
-
contains
Description copied from interface:LocationChecks if this location contains a point.- Parameters:
point- the point to check- Returns:
- true if this contains p, otherwise false
-
equals
-
hashCode
- Overrides:
hashCodein classAbstractLocation
-
intersection
Description copied from interface:LocationReturns a Location that contains all points common to both ranges.- Specified by:
intersectionin interfaceLocation- Overrides:
intersectionin classAbstractLocation- Parameters:
loc- the Location to intersect with- Returns:
- a Location containing all points common to both, or the empty range if there are no such points
-
symbols
Description copied from interface:LocationReturn the symbols in a sequence that fall within this range.- Parameters:
slist- the SymbolList to process- Returns:
- the SymbolList containing the symbols in seq in this range
-
isContiguous
Description copied from interface:LocationDetermine if a Location is contiguous.- Returns:
trueif and only if this Location contains every point frommintomaxinclusive.
-
blockIterator
Description copied from interface:LocationReturn an Iterator over the set of maximal contiguous sub-locations.Given any location, it can be considered to contain zero or more maximal contiguous blocks of width 1 or greater. The empty location is composed from nothing. A contiguous location is composed from itself. A non-contiguous location is composed from contiguous blocks seperated by gaps.
This method should return an Iterator over these maximally contiguous blocks starting with the left-most block, and finishing at the right-most block.
- Returns:
- an Iterator over Location objects that are the maximally contiguous set of locations contained within this location
-
translate
Description copied from interface:LocationCreate a location that is a translation of this location.- Parameters:
dist- the distance to translate (to the right)
-
toString
-