public class CircularLocation extends AbstractLocationDecorator
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.
empty, full, naturalOrder| Constructor and Description | 
|---|
| 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. | 
| Modifier and Type | Method and Description | 
|---|---|
| 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(Object o)Checks if this location is equivalent to the other. | 
| ListIterator | fivePrimeBlockIterator()Iterates over the location blocks in order starting with the most 5' | 
| int | get3PrimeEnd() | 
| int | get5PrimeEnd()The point at which indicates the 5' end of the Location. | 
| int | getLength() | 
| int | getMax()This will give you the coordinate of the maximum point contained by this
 Location. | 
| int | getMin()This will give you the coordinate of the minimum point contained by this
 Location. | 
| 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. | 
| String | toString() | 
| Location | union(Location l)Return a Location containing all points in either ranges. | 
blockIterator, getDecorator, getWrapped, newInstance, translatepublic 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 sequenceIllegalArgumentException - if the 5' end doesn't match the min coordinate
 of either wrapped or one of its blocks.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 AbstractLocationDecoratorpublic boolean contains(int p)
Locationcontains in interface Locationcontains in class AbstractLocationDecoratorp - the point to checkpublic Location intersection(Location l)
Locationintersection in interface Locationintersection in class AbstractLocationDecoratorl - the Location to intersect withpublic boolean overlaps(Location l)
LocationAbstractly, two locations overlap if they both contain any point.
overlaps in interface Locationoverlaps in class AbstractLocationDecoratorl - the Location to checkpublic Location union(Location l)
Locationunion in interface Locationunion in class AbstractLocationDecoratorl - the Location to union withpublic boolean contains(Location l)
LocationAbstractly, a location contains another if every point in the other location is contained within this one.
contains in interface Locationcontains in class AbstractLocationDecoratorl - the Location to checkpublic boolean equals(Object o)
LocationAbstractly, 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 Locationequals in class AbstractLocationDecoratoro - the Object to checkpublic boolean isContiguous()
isContiguous in interface LocationisContiguous in class AbstractLocationDecoratorpublic int get5PrimeEnd()
getMin()fivePrimeBlockIterator(), 
getMin(), 
get3PrimeEnd()public int get3PrimeEnd()
fivePrimeBlockIterator(), 
getMax(), 
get5PrimeEnd()public int getMin()
get5PrimeEnd()getMin in interface LocationgetMin in class AbstractLocationDecoratorget5PrimeEnd()public int getMax()
getLength().
 If you want to be guarenteed of getting
 the rightmost coordinate then call get3PrimeEnd()getMax in interface LocationgetMax in class AbstractLocationDecoratorget3PrimeEnd()public SymbolList symbols(SymbolList seq)
Locationsymbols in interface Locationsymbols in class AbstractLocationDecoratorseq - the SymbolList to processpublic ListIterator fivePrimeBlockIterator()
AbstractLocationDecorator.blockIterator(), 
get5PrimeEnd()Copyright © 2020 BioJava. All rights reserved.