public class EmptyRichLocation extends Unchangeable implements RichLocation
RichLocation.Strand, RichLocation.Tools
Annotatable.AnnotationForwarder
CIRCULAR, EMPTY_LOCATION, FEATURE, NOTE, RANK, TERM
empty, full, naturalOrder
ANNOTATION
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, removeForwarder
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
public EmptyRichLocation()
public RichFeature getFeature()
getFeature
in interface RichLocation
public void sort()
sort
in interface RichLocation
public void setFeature(RichFeature feature) throws ChangeVetoException
setFeature
in interface RichLocation
feature
- the feature.ChangeVetoException
public CrossRef getCrossRef()
getCrossRef
in interface RichLocation
public Annotation getAnnotation()
getAnnotation
in interface Annotatable
public RichAnnotation getRichAnnotation()
getRichAnnotation
in interface RichAnnotatable
public Set getNoteSet()
getNoteSet
in interface RichAnnotatable
Note
public void setNoteSet(Set notes) throws ChangeVetoException
setNoteSet
in interface RichAnnotatable
notes
- 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.Note
public ComparableTerm getTerm()
getTerm
in interface RichLocation
public void setTerm(ComparableTerm term) throws ChangeVetoException
setTerm
in interface RichLocation
term
- the term this location should adopt.ChangeVetoException
- in case of error.public int getCircularLength()
getCircularLength
in interface RichLocation
public void setCircularLength(int sourceSeqLength) throws ChangeVetoException
setCircularLength
in interface RichLocation
sourceSeqLength
- the circular length of this locationChangeVetoException
- if it doesn't want to change.public RichLocation.Strand getStrand()
getStrand
in interface RichLocation
public int getRank()
getRank
in interface RichLocation
public void setRank(int rank) throws ChangeVetoException
setRank
in interface RichLocation
rank
- 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 RichLocation
public Position getMaxPosition()
getMaxPosition
in interface RichLocation
public void setPositionResolver(PositionResolver p)
setPositionResolver
in interface RichLocation
p
- 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 Location
public boolean isContiguous()
isContiguous
in interface Location
true
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 Location
decoratorClass
- the Class to checkpublic Location newInstance(Location loc)
loc
.
The default behavior is to return loc
.
ALWAYS RETURNS PASSED LOCATION
newInstance
in interface Location
loc
- 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 Location
l
- the Location to intersect withpublic void setCrossRefResolver(CrossReferenceResolver r)
setCrossRefResolver
in interface RichLocation
r
- 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 Comparable
Copyright © 2014 BioJava. All rights reserved.