public class EmptyRichLocation extends Unchangeable implements RichLocation
RichLocation.Strand, RichLocation.ToolsAnnotatable.AnnotationForwarderCIRCULAR, EMPTY_LOCATION, FEATURE, NOTE, RANK, TERMempty, full, naturalOrderANNOTATION| Constructor and Description |
|---|
EmptyRichLocation() |
| Modifier and Type | Method and Description |
|---|---|
Iterator |
blockIterator()
Return an Iterator over the set of maximal contiguous sub-locations.
|
int |
compareTo(Object o)
Empty Rich Locations return 0 when compared to other Empty ones,
or -1 otherwise.
|
boolean |
contains(int p)
Checks if this location contains a point.
|
boolean |
contains(Location l)
Checks if this location contains the other.
|
boolean |
equals(Object o)
Checks if this location is equivalent to the other.
|
Annotation |
getAnnotation()
Should return the associated annotation object.
|
int |
getCircularLength()
Retrieves the circular length of this location.
|
CrossRef |
getCrossRef()
Retrieves the crossref associated with this location.
|
Location |
getDecorator(Class decoratorClass)
Checks the decorator chain for an instance of
|
RichFeature |
getFeature()
Retrieves the feature this location is associated with.
|
int |
getMax()
The maximum position contained.
|
Position |
getMaxPosition()
Retrieves the end position of this location.
|
int |
getMin()
The minimum position contained.
|
Position |
getMinPosition()
Retrieves the start position of this location.
|
Set |
getNoteSet()
Returns the set of notes associated with this object.
|
int |
getRank()
Retrieves the rank associated with this location.
|
RichAnnotation |
getRichAnnotation()
Return the associated annotation object.
|
RichLocation.Strand |
getStrand()
Retrieves the strand associated with this location.
|
ComparableTerm |
getTerm()
Retrieves the term associated with this location.
|
int |
hashCode()
ALWAYS RETURNS 17
|
Location |
intersection(Location l)
Returns a Location that contains all points common to both ranges.
|
boolean |
isContiguous()
Determine if a Location is contiguous.
|
Location |
newInstance(Location loc)
Create a new instance of Location with all of the same decorators as this
instance but with the data stored in
loc. |
boolean |
overlaps(Location l)
Checks if these two locations overlap, using this location's
concept of overlapping.
|
void |
setCircularLength(int sourceSeqLength)
Sets the circular length of this location.
|
void |
setCrossRefResolver(CrossReferenceResolver r)
Sets the cross ref resolver to use when retrieving remote symbols.
|
void |
setFeature(RichFeature feature)
Sets the feature this location is associated with.
|
void |
setNoteSet(Set notes)
Clears the notes associated with this object and replaces them with
the contents of this set.
|
void |
setPositionResolver(PositionResolver p)
Sets the resolver to use when working out actual base coordinates from
fuzzy positions.
|
void |
setRank(int rank)
Sets the rank for this location.
|
void |
setTerm(ComparableTerm term)
Sets the term for this location.
|
void |
sort()
Sorts the member locations of a compound location.
|
SymbolList |
symbols(SymbolList seq)
Return the symbols in a sequence that fall within this range.
|
String |
toString()
ALWAYS RETURNS "empty"
|
Location |
translate(int dist)
Create a location that is a translation of this location.
|
Location |
union(Location l)
Return a Location containing all points in either ranges.
|
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarderclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListenerpublic EmptyRichLocation()
public RichFeature getFeature()
getFeature in interface RichLocationpublic void sort()
sort in interface RichLocationpublic void setFeature(RichFeature feature) throws ChangeVetoException
setFeature in interface RichLocationfeature - the feature.ChangeVetoExceptionpublic CrossRef getCrossRef()
getCrossRef in interface RichLocationpublic Annotation getAnnotation()
getAnnotation in interface Annotatablepublic RichAnnotation getRichAnnotation()
getRichAnnotation in interface RichAnnotatablepublic Set getNoteSet()
getNoteSet in interface RichAnnotatableNotepublic void setNoteSet(Set notes) throws ChangeVetoException
setNoteSet in interface RichAnnotatablenotes - the set of Note objects to replace the existing ones with.ChangeVetoException - if the set is null or contains any objects
that are not Note objects.Notepublic ComparableTerm getTerm()
getTerm in interface RichLocationpublic void setTerm(ComparableTerm term) throws ChangeVetoException
setTerm in interface RichLocationterm - the term this location should adopt.ChangeVetoException - in case of error.public int getCircularLength()
getCircularLength in interface RichLocationpublic void setCircularLength(int sourceSeqLength) throws ChangeVetoException
setCircularLength in interface RichLocationsourceSeqLength - the circular length of this locationChangeVetoException - if it doesn't want to change.public RichLocation.Strand getStrand()
getStrand in interface RichLocationpublic int getRank()
getRank in interface RichLocationpublic void setRank(int rank) throws ChangeVetoException
setRank in interface RichLocationrank - the rank this location should adopt.ChangeVetoException - in case of error.public int getMax()
WARNING: The location will not contain every point between getMin()
and getMax() if isContiguous() is false. If isContiguous()
does return false you should use the Iterator returned by blockIterator()
to iterate over the minimum set of contiguous blocks that make up this Location
ALWAYS RETURNS ZERO
public int getMin()
WARNING: The location will not contain every point between getMin()
and getMax() if isContiguous() is false. If isContiguous()
does return false you should use the Iterator returned by blockIterator()
to iterate over the minimum set of contiguous blocks that make up this Location
ALWAYS RETURNS ZERO
public Position getMinPosition()
getMinPosition in interface RichLocationpublic Position getMaxPosition()
getMaxPosition in interface RichLocationpublic void setPositionResolver(PositionResolver p)
setPositionResolver in interface RichLocationp - the position resolver to use.public 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 finishing at the right-most block. ALWAYS RETURNS THE EMPTY SET ITERATOR
blockIterator in interface Locationpublic boolean isContiguous()
isContiguous in interface Locationtrue if and only if this Location
contains every point from min to
max inclusive.public boolean contains(int p)
public Location getDecorator(Class decoratorClass)
The default behavior is to return null. If the current object is a
decorator and is an instance of
getDecorator in interface LocationdecoratorClass - the Class to checkpublic Location newInstance(Location loc)
loc.
The default behavior is to return loc.
ALWAYS RETURNS PASSED LOCATION
newInstance in interface Locationloc - the Location to use as templatepublic Location translate(int dist)
public boolean contains(Location l)
Abstractly, a location contains another if every point in the other location is contained within this one. ALWAYS RETURNS FALSE
public boolean overlaps(Location l)
Abstractly, two locations overlap if they both contain any point. ALWAYS RETURNS FALSE
public Location union(Location l)
public Location intersection(Location l)
intersection in interface Locationl - the Location to intersect withpublic void setCrossRefResolver(CrossReferenceResolver r)
setCrossRefResolver in interface RichLocationr - the resolver to use.public SymbolList symbols(SymbolList seq)
public boolean equals(Object o)
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. Empty Rich Locations only match other Empty Rich Locations
public int compareTo(Object o)
compareTo in interface ComparableCopyright © 2020 BioJava. All rights reserved.