Package org.biojavax.bio.seq
Interface RichLocation
-
- All Superinterfaces:
Annotatable,Changeable,Comparable,Location,RichAnnotatable
- All Known Implementing Classes:
CompoundRichLocation,EmptyRichLocation,MultiSourceCompoundRichLocation,SimpleRichLocation
public interface RichLocation extends Location, RichAnnotatable, Comparable
Describes locations, and adds the concepts of circularity, fuzziness, annotations, and cross-references to other databases. Also includes strands.- Since:
- 1.5
- Author:
- Richard Holland, George Waldon - bug fix
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classRichLocation.StrandThis class represents a strand on which a location may lie.static classRichLocation.ToolsSome useful tools for working with Locations.-
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
-
-
Field Summary
Fields Modifier and Type Field Description static ChangeTypeCIRCULARstatic RichLocationEMPTY_LOCATIONThe empty location matches nothing.static ChangeTypeFEATUREstatic ChangeTypeNOTEstatic ChangeTypeRANKstatic ChangeTypeTERM-
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
-
Fields inherited from interface org.biojava.bio.symbol.Location
empty, full, naturalOrder
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetCircularLength()Retrieves the circular length of this location.CrossRefgetCrossRef()Retrieves the crossref associated with this location.RichFeaturegetFeature()Retrieves the feature this location is associated with.PositiongetMaxPosition()Retrieves the end position of this location.PositiongetMinPosition()Retrieves the start position of this location.intgetRank()Retrieves the rank associated with this location.RichLocation.StrandgetStrand()Retrieves the strand associated with this location.ComparableTermgetTerm()Retrieves the term associated with this location.voidsetCircularLength(int sourceSeqLength)Sets the circular length of this location.voidsetCrossRefResolver(CrossReferenceResolver r)Sets the cross ref resolver to use when retrieving remote symbols.voidsetFeature(RichFeature feature)Sets the feature this location is associated with.voidsetPositionResolver(PositionResolver p)Sets 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.-
Methods inherited from interface org.biojava.bio.Annotatable
getAnnotation
-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from interface java.lang.Comparable
compareTo
-
Methods inherited from interface org.biojava.bio.symbol.Location
blockIterator, contains, contains, equals, getDecorator, getMax, getMin, intersection, isContiguous, newInstance, overlaps, symbols, translate, union
-
Methods inherited from interface org.biojavax.RichAnnotatable
getNoteSet, getRichAnnotation, setNoteSet
-
-
-
-
Field Detail
-
NOTE
static final ChangeType NOTE
-
TERM
static final ChangeType TERM
-
RANK
static final ChangeType RANK
-
CIRCULAR
static final ChangeType CIRCULAR
-
FEATURE
static final ChangeType FEATURE
-
EMPTY_LOCATION
static final RichLocation EMPTY_LOCATION
The empty location matches nothing.
-
-
Method Detail
-
sort
void 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.
-
getFeature
RichFeature getFeature()
Retrieves the feature this location is associated with. May be null.- Returns:
- the feature.
-
setFeature
void setFeature(RichFeature feature) throws ChangeVetoException
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.- Parameters:
feature- the feature.- Throws:
ChangeVetoException
-
getCrossRef
CrossRef getCrossRef()
Retrieves the crossref associated with this location.- Returns:
- the crossref.
-
getTerm
ComparableTerm getTerm()
Retrieves the term associated with this location.- Returns:
- the term.
-
setTerm
void setTerm(ComparableTerm term) throws ChangeVetoException
Sets the term for this location.- Parameters:
term- the term this location should adopt.- Throws:
ChangeVetoException- in case of error.
-
getStrand
RichLocation.Strand getStrand()
Retrieves the strand associated with this location.- Returns:
- the strand.
-
getRank
int getRank()
Retrieves the rank associated with this location.- Returns:
- the rank.
-
setRank
void setRank(int rank) throws ChangeVetoException
Sets the rank for this location.- Parameters:
rank- the rank this location should adopt.- Throws:
ChangeVetoException- in case of error.
-
getMinPosition
Position getMinPosition()
Retrieves the start position of this location.- Returns:
- the position.
-
getMaxPosition
Position getMaxPosition()
Retrieves the end position of this location.- Returns:
- the position.
-
setPositionResolver
void setPositionResolver(PositionResolver p)
Sets the resolver to use when working out actual base coordinates from fuzzy positions.- Parameters:
p- the position resolver to use.
-
getCircularLength
int 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.- Returns:
- the position.
-
setCircularLength
void setCircularLength(int sourceSeqLength) throws ChangeVetoException
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.- Parameters:
sourceSeqLength- the circular length of this location- Throws:
ChangeVetoException- if it doesn't want to change.
-
setCrossRefResolver
void setCrossRefResolver(CrossReferenceResolver r)
Sets the cross ref resolver to use when retrieving remote symbols. If none is given, then the default from RichObjectFactory.getDefaultCrossRefResolver() is used.- Parameters:
r- the resolver to use.
-
-