Package org.biojava.bio.symbol
Class PointLocation
- java.lang.Object
-
- org.biojava.bio.symbol.AbstractLocation
-
- org.biojava.bio.symbol.AbstractRangeLocation
-
- org.biojava.bio.symbol.PointLocation
-
- All Implemented Interfaces:
Serializable
,Location
public class PointLocation extends AbstractRangeLocation implements Location, Serializable
A location representing a single point. This can be considered as the singleton set of one integer.min and max are always equal for this implementation
- Author:
- Matthew Pocock
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.biojava.bio.symbol.Location
empty, full, naturalOrder
-
-
Constructor Summary
Constructors Constructor Description PointLocation(int point)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(int p)
Checks if this location contains a point.int
getMax()
The maximum position contained.int
getMin()
The minimum position contained.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, 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
-
Methods inherited from interface org.biojava.bio.symbol.Location
blockIterator, contains, equals, getDecorator, intersection, isContiguous, newInstance, overlaps, symbols, union
-
-
-
-
Constructor Detail
-
PointLocation
public PointLocation(int point)
-
-
Method Detail
-
getMin
public int 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
public int 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
-
contains
public boolean contains(int p)
Description copied from interface:Location
Checks if this location contains a point.- Specified by:
contains
in interfaceLocation
- Overrides:
contains
in classAbstractRangeLocation
- Parameters:
p
- the point to check- Returns:
- true if this contains p, otherwise false
-
translate
public Location translate(int dist)
Description copied from interface:Location
Create a location that is a translation of this location.
-
-