Package org.biojavax.bio.seq
Class MultiSourceCompoundRichLocation
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojavax.bio.seq.SimpleRichLocation
-
- org.biojavax.bio.seq.CompoundRichLocation
-
- org.biojavax.bio.seq.MultiSourceCompoundRichLocation
-
- All Implemented Interfaces:
Comparable,Annotatable,Location,Changeable,RichLocation,RichAnnotatable
public class MultiSourceCompoundRichLocation extends CompoundRichLocation implements RichLocation
An implementation of RichLocation which possibly covers multiple locations, on different strands, different circular lengths, or different sequences.- Since:
- 1.5
- Author:
- Richard Holland, Mark Schreiber
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable
Annotatable.AnnotationForwarder
-
Nested classes/interfaces inherited from interface org.biojavax.bio.seq.RichLocation
RichLocation.Strand, RichLocation.Tools
-
-
Field Summary
-
Fields inherited from class org.biojavax.bio.seq.CompoundRichLocation
members, size
-
Fields inherited from class org.biojavax.bio.seq.SimpleRichLocation
circularLength, term
-
Fields inherited from interface org.biojava.bio.Annotatable
ANNOTATION
-
Fields inherited from interface org.biojava.bio.symbol.Location
empty, full, naturalOrder
-
Fields inherited from interface org.biojavax.bio.seq.RichLocation
CIRCULAR, EMPTY_LOCATION, FEATURE, NOTE, RANK, TERM
-
-
Constructor Summary
Constructors Constructor Description MultiSourceCompoundRichLocation(Collection members)Constructs a MultiSourceCompoundRichLocation from the given set of members, with the default term of "join".MultiSourceCompoundRichLocation(ComparableTerm term, Collection members)Constructs a MultiSourceCompoundRichLocation from the given set of members.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCircularLength()Retrieves the circular length of this location.CrossRefgetCrossRef()Retrieves the crossref associated with this location.intgetMax()The maximum position contained.PositiongetMaxPosition()Retrieves the end position of this location.intgetMin()The minimum position contained.PositiongetMinPosition()Retrieves the start position of this location.RichLocation.StrandgetStrand()Retrieves the strand associated with this location.voidsetCircularLength(int sourceSeqLength)Sets the circular length of this location.Locationtranslate(int dist)Create a location that is a translation of this location.-
Methods inherited from class org.biojavax.bio.seq.CompoundRichLocation
blockIterator, compareTo, contains, contains, equals, getAnnotation, getDecorator, getJoinTerm, getNoteSet, getOrderTerm, getRichAnnotation, hashCode, intersection, isContiguous, newInstance, overlaps, setCrossRefResolver, setFeature, setNoteSet, setTerm, sort, symbols, toString, union
-
Methods inherited from class org.biojavax.bio.seq.SimpleRichLocation
getFeature, getId, getRank, getTerm, posmax, posmin, setCrossRef, setId, setMaxPosition, setMinPosition, setPositionResolver, setRank, setStrand
-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
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, intersection, isContiguous, newInstance, overlaps, symbols, union
-
Methods inherited from interface org.biojavax.RichAnnotatable
getNoteSet, getRichAnnotation, setNoteSet
-
Methods inherited from interface org.biojavax.bio.seq.RichLocation
getFeature, getRank, getTerm, setCrossRefResolver, setFeature, setPositionResolver, setRank, setTerm, sort
-
-
-
-
Constructor Detail
-
MultiSourceCompoundRichLocation
public MultiSourceCompoundRichLocation(Collection members)
Constructs a MultiSourceCompoundRichLocation from the given set of members, with the default term of "join". Note that you really shouldn't use this if you are unsure if your members set contains overlapping members. Use RichLocation.Tools.construct() instead. The members collection must only contain Location instances. Any that are not RichLocations will be converted using RichLocation.Tools.enrich().- Parameters:
members- the members to put into the compound location.- See Also:
RichLocation.Tools
-
MultiSourceCompoundRichLocation
public MultiSourceCompoundRichLocation(ComparableTerm term, Collection members)
Constructs a MultiSourceCompoundRichLocation from the given set of members. Note that you really shouldn't use this if you are unsure if your members set contains overlapping members. Use RichLocation.Tools.construct(members) instead. The members collection must only contain Location instances. Any that are not RichLocations will be converted using RichLocation.Tools.enrich().- Parameters:
term- the term to use when describing the group of members.members- the members to put into the compound location.- See Also:
RichLocation.Tools
-
-
Method Detail
-
getCrossRef
public CrossRef getCrossRef()
Retrieves the crossref associated with this location. ALWAYS RETURNS NULL- Specified by:
getCrossRefin interfaceRichLocation- Overrides:
getCrossRefin classSimpleRichLocation- Returns:
- the crossref.
-
getCircularLength
public 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. ALWAYS RETURNS ZERO- Specified by:
getCircularLengthin interfaceRichLocation- Overrides:
getCircularLengthin classSimpleRichLocation- Returns:
- the position.
-
setCircularLength
public 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. RECURSIVELY APPLIES CALL TO ALL MEMBERS NOT IMPLEMENTED- Specified by:
setCircularLengthin interfaceRichLocation- Overrides:
setCircularLengthin classCompoundRichLocation- Parameters:
sourceSeqLength- the circular length of this location- Throws:
ChangeVetoException- ALWAYS
-
getStrand
public RichLocation.Strand getStrand()
Retrieves the strand associated with this location.- Specified by:
getStrandin interfaceRichLocation- Overrides:
getStrandin classSimpleRichLocation- Returns:
- the strand.
-
getMin
public int 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 ONE- Specified by:
getMinin interfaceLocation- Overrides:
getMinin classSimpleRichLocation- Returns:
- the minimum position contained
-
getMax
public int 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 COMBINED LENGTH OF MEMBERS- Specified by:
getMaxin interfaceLocation- Overrides:
getMaxin classSimpleRichLocation- Returns:
- the maximum position contained
-
getMinPosition
public Position getMinPosition()
Retrieves the start position of this location. ALWAYS RETURNS A POINT POSITION AT POINT 1- Specified by:
getMinPositionin interfaceRichLocation- Overrides:
getMinPositionin classSimpleRichLocation- Returns:
- the position.
-
getMaxPosition
public Position getMaxPosition()
Retrieves the end position of this location. ALWAYS RETURNS A POINT POSITION AT POINT EQUIVALENT TO COMBINED LENGTH OF MEMBERS- Specified by:
getMaxPositionin interfaceRichLocation- Overrides:
getMaxPositionin classSimpleRichLocation- Returns:
- the position.
-
translate
public Location translate(int dist)
Create a location that is a translation of this location. Recursively translates all members of this location. Recursively translates all members of this location.- Specified by:
translatein interfaceLocation- Overrides:
translatein classCompoundRichLocation- Parameters:
dist- the distance to translate (to the right)
-
-