Class EmptyRichLocation
- All Implemented Interfaces:
Comparable,Annotatable,Location,Changeable,RichLocation,RichAnnotatable
- Since:
- 1.5
- Author:
- Richard Holland, Mark Schreiber, George Waldon
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarderNested classes/interfaces inherited from interface org.biojavax.bio.seq.RichLocation
RichLocation.Strand, RichLocation.Tools -
Field Summary
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATIONFields inherited from interface org.biojava.bio.symbol.Location
empty, full, naturalOrderFields inherited from interface org.biojavax.bio.seq.RichLocation
CIRCULAR, EMPTY_LOCATION, FEATURE, NOTE, RANK, TERM -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturn an Iterator over the set of maximal contiguous sub-locations.intEmpty Rich Locations return 0 when compared to other Empty ones, or -1 otherwise.booleancontains(int p) Checks if this location contains a point.booleanChecks if this location contains the other.booleanChecks if this location is equivalent to the other.Should return the associated annotation object.intRetrieves the circular length of this location.Retrieves the crossref associated with this location.getDecorator(Class decoratorClass) Checks the decorator chain for an instance ofdecoratorClass and return it if found.Retrieves the feature this location is associated with.intgetMax()The maximum position contained.Retrieves the end position of this location.intgetMin()The minimum position contained.Retrieves the start position of this location.Returns the set of notes associated with this object.intgetRank()Retrieves the rank associated with this location.Return the associated annotation object.Retrieves the strand associated with this location.getTerm()Retrieves the term associated with this location.inthashCode()ALWAYS RETURNS 17Returns a Location that contains all points common to both ranges.booleanDetermine if a Location is contiguous.newInstance(Location loc) Create a new instance of Location with all of the same decorators as this instance but with the data stored inloc.booleanChecks if these two locations overlap, using this location's concept of overlapping.voidsetCircularLength(int sourceSeqLength) Sets the circular length of this location.voidSets the cross ref resolver to use when retrieving remote symbols.voidsetFeature(RichFeature feature) Sets the feature this location is associated with.voidsetNoteSet(Set notes) Clears the notes associated with this object and replaces them with the contents of this set.voidSets the resolver to use when working out actual base coordinates from fuzzy positions.voidsetRank(int rank) Sets the rank for this location.voidsetTerm(ComparableTerm term) Sets the term for this location.voidsort()Sorts the member locations of a compound location.symbols(SymbolList seq) Return the symbols in a sequence that fall within this range.toString()ALWAYS RETURNS "empty"translate(int dist) Create a location that is a translation of this location.Return a Location containing all points in either ranges.Methods inherited from class org.biojava.utils.Unchangeable
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarderMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Constructor Details
-
EmptyRichLocation
public EmptyRichLocation()
-
-
Method Details
-
getFeature
Retrieves the feature this location is associated with. May be null. ALWAYS RETURNS NULL- Specified by:
getFeaturein interfaceRichLocation- Returns:
- the feature.
-
sort
Sorts the member locations of a compound location. Does nothing for non-compound locations. Sorting depends on the compareTo() method of the member locations - usually they will be sorted by their start position. This might be useful when used with the location returned by a union or intersection, or when setting the term of a compound location to ORDER_TERM. DOES NOTHING- Specified by:
sortin interfaceRichLocation
-
setFeature
Sets the feature this location is associated with. If null, that's fine, but you won't be able to persist it to the database until you give it a not-null value. NOT IMPLEMENTED- Specified by:
setFeaturein interfaceRichLocation- Parameters:
feature- the feature.- Throws:
ChangeVetoException
-
getCrossRef
Retrieves the crossref associated with this location. ALWAYS RETURNS NULL- Specified by:
getCrossRefin interfaceRichLocation- Returns:
- the crossref.
-
getAnnotation
Should return the associated annotation object. ALWAYS RETURNS THE EMPTY ANNOTATION- Specified by:
getAnnotationin interfaceAnnotatable- Returns:
- an Annotation object, never null
-
getRichAnnotation
Return the associated annotation object. ALWAYS RETURNS THE EMPTY ANNOTATION- Specified by:
getRichAnnotationin interfaceRichAnnotatable- Returns:
- a RichAnnotation object, never null
-
getNoteSet
Returns the set of notes associated with this object. Would normally delegate call to internal RichAnnotation instance. ALWAYS RETURNS THE EMPTY ANNOTATION NOTE SET- Specified by:
getNoteSetin interfaceRichAnnotatable- Returns:
- set a set of Note objects.
- See Also:
-
setNoteSet
Clears the notes associated with this object and replaces them with the contents of this set. Would normally delegate call to internal RichAnnotation instance. NOT IMPLEMENTED- Specified by:
setNoteSetin interfaceRichAnnotatable- Parameters:
notes- the set of Note objects to replace the existing ones with.- Throws:
ChangeVetoException- if the set is null or contains any objects that are not Note objects.- See Also:
-
getTerm
Retrieves the term associated with this location. ALWAYS RETURNS NULL- Specified by:
getTermin interfaceRichLocation- Returns:
- the term.
-
setTerm
Sets the term for this location. NOT IMPLEMENTED- Specified by:
setTermin interfaceRichLocation- Parameters:
term- the term this location should adopt.- Throws:
ChangeVetoException- in case of error.
-
getCircularLength
Retrieves the circular length of this location. If it is 0, the location is not circular. If it is not zero, then the number refers to the wrapping length of the location. eg. 100 would signify that a position of 112 would actually be a position of 112-100 = 12. ALWAYS RETURNS ZERO- Specified by:
getCircularLengthin interfaceRichLocation- Returns:
- the position.
-
setCircularLength
Sets the circular length of this location. If it is 0, the location is not circular. If it is not zero, then the number refers to the wrapping length of the location. eg. 100 would signify that a position of 112 would actually be a position of 112-100 = 12. NOT IMPLEMENTED- Specified by:
setCircularLengthin interfaceRichLocation- Parameters:
sourceSeqLength- the circular length of this location- Throws:
ChangeVetoException- if it doesn't want to change.
-
getStrand
Retrieves the strand associated with this location. ALWAYS RETURNS THE UNKNOWN STRAND- Specified by:
getStrandin interfaceRichLocation- Returns:
- the strand.
-
getRank
Retrieves the rank associated with this location. ALWAYS RETURNS ZERO- Specified by:
getRankin interfaceRichLocation- Returns:
- the rank.
-
setRank
Sets the rank for this location. NOT IMPLEMENTED- Specified by:
setRankin interfaceRichLocation- Parameters:
rank- the rank this location should adopt.- Throws:
ChangeVetoException- in case of error.
-
getMax
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 theIteratorreturned byblockIterator()to iterate over the minimum set of contiguous blocks that make up thisLocationALWAYS RETURNS ZERO -
getMin
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 theIteratorreturned byblockIterator()to iterate over the minimum set of contiguous blocks that make up thisLocationALWAYS RETURNS ZERO -
getMinPosition
Retrieves the start position of this location. ALWAYS RETURNS THE EMPTY POSITION- Specified by:
getMinPositionin interfaceRichLocation- Returns:
- the position.
-
getMaxPosition
Retrieves the end position of this location. ALWAYS RETURNS THE EMPTY POSITION- Specified by:
getMaxPositionin interfaceRichLocation- Returns:
- the position.
-
setPositionResolver
Sets the resolver to use when working out actual base coordinates from fuzzy positions. This method is ignored in the empty location because positions are fixed an cannot be modified.- Specified by:
setPositionResolverin interfaceRichLocation- Parameters:
p- the position resolver to use.
-
blockIterator
Return an Iterator over the set of maximal contiguous sub-locations.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
- Specified by:
blockIteratorin interfaceLocation- Returns:
- an Iterator over Location objects that are the maximally contiguous set of locations contained within this location
-
isContiguous
Determine if a Location is contiguous. ALWAYS RETURNS TRUE- Specified by:
isContiguousin interfaceLocation- Returns:
trueif and only if this Location contains every point frommintomaxinclusive.
-
contains
Checks if this location contains a point. ALWAYS RETURNS FALSE -
getDecorator
Checks the decorator chain for an instance ofdecoratorClass and return it if found.The default behavior is to return null. If the current object is a decorator and is an instance of
decoratorClass it should return itself. Otherwise, the decorator should chain this method onto the instance it wraps. ALWAYS RETURNS NULL- Specified by:
getDecoratorin interfaceLocation- Parameters:
decoratorClass- the Class to check- Returns:
- a Location if an instance of this class is present in the decorator chain and null otherwise.
-
newInstance
Create a new instance of Location with all of the same decorators as this instance but with the data stored inloc.The default behavior is to return
loc unchanged. If the class is a location decorator then it should instantiate an instance of the same type that decoratesloc. ALWAYS RETURNS PASSED LOCATION- Specified by:
newInstancein interfaceLocation- Parameters:
loc- the Location to use as template- Returns:
- a Location instance based on loc with the same decorators as the current instance
-
translate
Create a location that is a translation of this location. ALWAYS RETURNS SELF -
contains
Checks if this location contains the other.Abstractly, a location contains another if every point in the other location is contained within this one. ALWAYS RETURNS FALSE
-
overlaps
Checks if these two locations overlap, using this location's concept of overlapping.Abstractly, two locations overlap if they both contain any point. ALWAYS RETURNS FALSE
-
union
Return a Location containing all points in either ranges. ALWAYS RETURNS PASSED LOCATION -
intersection
Returns a Location that contains all points common to both ranges. ALWAYS RETURNS SELF- Specified by:
intersectionin interfaceLocation- Parameters:
l- the Location to intersect with- Returns:
- a Location containing all points common to both, or the empty range if there are no such points
-
setCrossRefResolver
Sets the cross ref resolver to use when retrieving remote symbols. If none is given, then the default from RichObjectFactory.getDefaultCrossRefResolver() is used. This method is ignored in the empty location because there is nothing to resolve.- Specified by:
setCrossRefResolverin interfaceRichLocation- Parameters:
r- the resolver to use.
-
symbols
Return the symbols in a sequence that fall within this range. ALWAYS RETURNS THE EMPTY SYMBOL LIST -
hashCode
ALWAYS RETURNS 17 -
equals
Checks if this location is equivalent to the other.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
-
compareTo
Empty Rich Locations return 0 when compared to other Empty ones, or -1 otherwise.- Specified by:
compareToin interfaceComparable
-
toString
ALWAYS RETURNS "empty"
-