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

Nested Class Summary
static class RichLocation.Strand
          This class represents a strand on which a location may lie.
static class RichLocation.Tools
          Some useful tools for working with Locations.
 
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
 
Field Summary
static ChangeType CIRCULAR
           
static RichLocation EMPTY_LOCATION
          The empty location matches nothing.
static ChangeType FEATURE
           
static ChangeType NOTE
           
static ChangeType RANK
           
static ChangeType TERM
           
 
Fields inherited from interface org.biojava.bio.symbol.Location
empty, full, naturalOrder
 
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
 
Method Summary
 int getCircularLength()
          Retrieves the circular length of this location.
 CrossRef getCrossRef()
          Retrieves the crossref associated with this location.
 RichFeature getFeature()
          Retrieves the feature this location is associated with.
 Position getMaxPosition()
          Retrieves the end position of this location.
 Position getMinPosition()
          Retrieves the start position of this location.
 int getRank()
          Retrieves the rank associated with this location.
 RichLocation.Strand getStrand()
          Retrieves the strand associated with this location.
 ComparableTerm getTerm()
          Retrieves the term associated with this location.
 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 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.
 
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
 
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
 

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.