|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.biojava.bio.symbol.AbstractLocationDecorator
org.biojava.bio.symbol.CircularLocation
Circular view onto an underlying Location instance. If the location overlaps the origin of the sequence the underlying location will be a CompoundLocation Note that in this case isContiguous() will return false. This behaviour is desirable for proper treatment of the location with LocationTools. To find if a location overlaps the origin use the overlapsOrigin() method
Note also that as a location that overlaps the origin is a compound location it's min will be 1 and its max will be length (by default). In these cases it is imperative to use the block iterator if you wish to know the 'true' min and max (bearing in mind that there is no logical value for a min or max on a circular sequence).
The symbols() method has been overridden to handle the weirdness of a location crossing the origin.
Field Summary |
Fields inherited from interface org.biojava.bio.symbol.Location |
empty, naturalOrder |
Constructor Summary | |
CircularLocation(Location wrapped,
int length)
Constructs a CircularLocation by wrapping another Location It is preferable to use LocationTools to make CircularLocations |
|
CircularLocation(Location wrapped,
int length,
int fivePrimeEnd)
Makes a CircularLocation where the 5' end of the Location is specified. |
Method Summary | |
boolean |
contains(int p)
Checks if this location contains a point. |
boolean |
contains(Location l)
Checks if this location contains the other. |
protected Location |
decorate(Location loc)
|
boolean |
equals(java.lang.Object o)
Checks if this location is equivalent to the other. |
java.util.ListIterator |
fivePrimeBlockIterator()
Iterates over the location blocks in order starting with the most 5' |
int |
get5PrimeEnd()
The point at which indicates the 5' end of the Location. |
int |
getLength()
|
Location |
intersection(Location l)
Returns a Location that contains all points common to both ranges. |
boolean |
isContiguous()
Delegates to the wrapped location. |
boolean |
overlaps(Location l)
Checks if these two locations overlap, using this location's concept of overlapping. |
boolean |
overlapsOrigin()
Does the Location overlap the origin (position 1) of the sequence? |
SymbolList |
symbols(SymbolList seq)
Return the symbols in a sequence that fall within this range. |
java.lang.String |
toString()
|
Location |
union(Location l)
Return a Location containing all points in either ranges. |
Methods inherited from class org.biojava.bio.symbol.AbstractLocationDecorator |
blockIterator, getDecorator, getMax, getMin, getWrapped, newInstance, translate |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CircularLocation(Location wrapped, int length)
wrapped
- the Location to wrap.length
- the length of the Sequencepublic CircularLocation(Location wrapped, int length, int fivePrimeEnd)
fivePrimeEnd
parameter must match one of the minimum coordinates
of the wrapped Location
. This allows the creation of Locations
whose polarity can be specified. This method is used internally by LocationTools.union()
and by the other constructor.
wrapped
- the Location
to map to a Circlelength
- the lenght of the circlefivePrimeEnd
- the 5' polar end of the sequence
java.lang.IllegalArgumentException
- if the 5' end doesn't match the min coordinate
of either wrapped
or one of its blocks.Method Detail |
public final int getLength()
public boolean overlapsOrigin()
If it does the Location will internally be composed of a CompoundLocation.
protected Location decorate(Location loc)
decorate
in class AbstractLocationDecorator
public boolean contains(int p)
Location
contains
in interface Location
contains
in class AbstractLocationDecorator
public Location intersection(Location l)
Location
intersection
in interface Location
intersection
in class AbstractLocationDecorator
public boolean overlaps(Location l)
Location
Abstractly, two locations overlap if they both contain any point.
overlaps
in interface Location
overlaps
in class AbstractLocationDecorator
public Location union(Location l)
Location
union
in interface Location
union
in class AbstractLocationDecorator
public boolean contains(Location l)
Location
Abstractly, a location contains another if every point in the other location is contained within this one.
contains
in interface Location
contains
in class AbstractLocationDecorator
public boolean equals(java.lang.Object o)
Location
Abstractly, a location is equal to another if for every point in one it is also in the other. This is equivalent to a.contains(b) && b.contains(a). You should call LocationTools.areEqual after casting l to Location.
equals
in interface Location
equals
in class AbstractLocationDecorator
public java.lang.String toString()
public boolean isContiguous()
isContiguous
in interface Location
isContiguous
in class AbstractLocationDecorator
public int get5PrimeEnd()
getMin()
fivePrimeBlockIterator()
,
AbstractLocationDecorator.getMin()
public SymbolList symbols(SymbolList seq)
Location
symbols
in interface Location
symbols
in class AbstractLocationDecorator
public java.util.ListIterator fivePrimeBlockIterator()
AbstractLocationDecorator.blockIterator()
,
get5PrimeEnd()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |