|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.biojava.bio.symbol.RangeLocation
A simple implementation of Location that contains all points between getMin and getMax inclusive.
This will in practice be the most commonly used pure-java implementation.
Inner classes inherited from class org.biojava.bio.symbol.Location |
Location.EmptyLocation,
Location.LocationComparator |
Fields inherited from interface org.biojava.bio.symbol.Location |
empty,
naturalOrder |
Constructor Summary | |
RangeLocation(int min,
int max)
|
Method Summary | |
java.util.Iterator |
blockIterator()
Return an Iterator over the set of maximal contiguous sub-locations. |
boolean |
contains(int p)
Checks if this location contains a point. |
boolean |
contains(Location l)
Checks if this location contains the other. |
boolean |
equals(Location l)
Tests for object equality against another location |
int |
getMax()
The maximum position contained. |
int |
getMin()
The minimum position contained. |
Location |
intersection(Location l)
Returns a Location that contains all points common to both ranges. |
boolean |
isContiguous()
Determine if a Location is contiguous. |
boolean |
overlaps(Location l)
Checks if these two locations overlap, using this locations's concept of overlaping. |
SymbolList |
symbols(SymbolList seq)
Return the symbols in a sequence that fall within this range. |
java.lang.String |
toString()
|
Location |
translate(int dist)
Create a location that is a translation of this location. |
Location |
union(Location l)
Return a Loctaion containing all points in either ranges. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public RangeLocation(int min, int max) throws java.lang.IndexOutOfBoundsException
Method Detail |
public int getMin()
public int getMax()
public boolean overlaps(Location l)
Abstractly, two locations overlap if they both contain any point.
l
- the Location to checkpublic boolean contains(Location l)
Abstractly, a location contains another if every point in the other location is contained within this one.
l
- the Location to checkpublic boolean contains(int p)
p
- the point to checkpublic boolean equals(Location l)
l
- the location to compare againstpublic Location intersection(Location l)
l
- the Location to intersect withpublic Location union(Location l)
l
- the Location to union withpublic SymbolList symbols(SymbolList seq)
seq
- the SymbolList to processpublic Location translate(int dist)
dist
- the distance to translate (to the right)public boolean isContiguous()
true
if and only if this Location
contains every point from min
to
max
inclusive.public java.util.Iterator blockIterator()
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 finnishing at the right-most block.
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |