|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.biojava.utils.Unchangeable
org.biojavax.bio.seq.EmptyRichLocation
public class EmptyRichLocation
An Empty implementation of RichLocation. This class is intended to act as a place holder for events like the intersection of two locations that do not overlap so that null need not be returned.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface org.biojavax.bio.seq.RichLocation |
|---|
RichLocation.Strand, RichLocation.Tools |
| Nested classes/interfaces inherited from interface org.biojava.bio.Annotatable |
|---|
Annotatable.AnnotationForwarder |
| Field Summary |
|---|
| Fields inherited from interface org.biojavax.bio.seq.RichLocation |
|---|
CIRCULAR, EMPTY_LOCATION, FEATURE, NOTE, RANK, TERM |
| Fields inherited from interface org.biojava.bio.symbol.Location |
|---|
empty, full, naturalOrder |
| Fields inherited from interface org.biojava.bio.Annotatable |
|---|
ANNOTATION |
| Constructor Summary | |
|---|---|
EmptyRichLocation()
|
|
| Method Summary | |
|---|---|
Iterator |
blockIterator()
Return an Iterator over the set of maximal contiguous sub-locations. ALWAYS RETURNS THE EMPTY SET ITERATOR |
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. ALWAYS RETURNS FALSE |
boolean |
contains(Location l)
Checks if this location contains the other. ALWAYS RETURNS FALSE |
boolean |
equals(Object o)
Checks if this location is equivalent to the other. Empty Rich Locations only match other Empty Rich Locations |
Annotation |
getAnnotation()
Should return the associated annotation object. ALWAYS RETURNS THE EMPTY ANNOTATION |
int |
getCircularLength()
Retrieves the circular length of this location. ALWAYS RETURNS ZERO |
CrossRef |
getCrossRef()
Retrieves the crossref associated with this location. ALWAYS RETURNS NULL |
Location |
getDecorator(Class decoratorClass)
Checks the decorator chain for an instance of |
RichFeature |
getFeature()
Retrieves the feature this location is associated with. ALWAYS RETURNS NULL |
int |
getMax()
The maximum position contained. ALWAYS RETURNS ZERO |
Position |
getMaxPosition()
Retrieves the end position of this location. ALWAYS RETURNS THE EMPTY POSITION |
int |
getMin()
The minimum position contained. ALWAYS RETURNS ZERO |
Position |
getMinPosition()
Retrieves the start position of this location. ALWAYS RETURNS THE EMPTY POSITION |
Set |
getNoteSet()
Returns the set of notes associated with this object. ALWAYS RETURNS THE EMPTY ANNOTATION NOTE SET |
int |
getRank()
Retrieves the rank associated with this location. ALWAYS RETURNS ZERO |
RichLocation.Strand |
getStrand()
Retrieves the strand associated with this location. ALWAYS RETURNS THE UNKNOWN STRAND |
ComparableTerm |
getTerm()
Retrieves the term associated with this location. ALWAYS RETURNS NULL |
int |
hashCode()
ALWAYS RETURNS 17 |
Location |
intersection(Location l)
Returns a Location that contains all points common to both ranges. ALWAYS RETURNS SELF |
boolean |
isContiguous()
Determine if a Location is contiguous. ALWAYS RETURNS TRUE |
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.
ALWAYS RETURNS PASSED LOCATION |
boolean |
overlaps(Location l)
Checks if these two locations overlap, using this location's concept of overlapping. ALWAYS RETURNS FALSE |
void |
setCircularLength(int sourceSeqLength)
Sets the circular length of this location. NOT IMPLEMENTED |
void |
setCrossRefResolver(CrossReferenceResolver r)
Sets the cross ref resolver to use when retrieving remote symbols. This method is ignored in the empty location because there is nothing to resolve. |
void |
setFeature(RichFeature feature)
Sets the feature this location is associated with. NOT IMPLEMENTED |
void |
setNoteSet(Set notes)
Clears the notes associated with this object and replaces them with the contents of this set. NOT IMPLEMENTED |
void |
setPositionResolver(PositionResolver p)
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. |
void |
setRank(int rank)
Sets the rank for this location. NOT IMPLEMENTED |
void |
setTerm(ComparableTerm term)
Sets the term for this location. NOT IMPLEMENTED |
void |
sort()
Sorts the member locations of a compound location. DOES NOTHING |
SymbolList |
symbols(SymbolList seq)
Return the symbols in a sequence that fall within this range. ALWAYS RETURNS THE EMPTY SYMBOL LIST |
String |
toString()
ALWAYS RETURNS "empty" |
Location |
translate(int dist)
Create a location that is a translation of this location. ALWAYS RETURNS SELF |
Location |
union(Location l)
Return a Location containing all points in either ranges. ALWAYS RETURNS PASSED LOCATION |
| Methods inherited from class org.biojava.utils.Unchangeable |
|---|
addChangeListener, addChangeListener, addForwarder, getForwarders, getListeners, isUnchanging, removeChangeListener, removeChangeListener, removeForwarder |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.biojava.utils.Changeable |
|---|
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener |
| Constructor Detail |
|---|
public EmptyRichLocation()
| Method Detail |
|---|
public RichFeature getFeature()
getFeature in interface RichLocationpublic void sort()
sort in interface RichLocation
public void setFeature(RichFeature feature)
throws ChangeVetoException
setFeature in interface RichLocationfeature - the feature.
ChangeVetoExceptionpublic CrossRef getCrossRef()
getCrossRef in interface RichLocationpublic Annotation getAnnotation()
getAnnotation in interface Annotatablepublic Set getNoteSet()
getNoteSet in interface RichAnnotatableNote
public void setNoteSet(Set notes)
throws ChangeVetoException
setNoteSet in interface RichAnnotatablenotes - 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.Notepublic ComparableTerm getTerm()
getTerm in interface RichLocation
public void setTerm(ComparableTerm term)
throws ChangeVetoException
setTerm in interface RichLocationterm - 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 RichLocationsourceSeqLength - the circular length of this location
ChangeVetoException - if it doesn't want to change.public RichLocation.Strand getStrand()
getStrand in interface RichLocationpublic int getRank()
getRank in interface RichLocation
public void setRank(int rank)
throws ChangeVetoException
setRank in interface RichLocationrank - 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
getMax in interface Locationpublic 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
getMin in interface Locationpublic Position getMinPosition()
getMinPosition in interface RichLocationpublic Position getMaxPosition()
getMaxPosition in interface RichLocationpublic void setPositionResolver(PositionResolver p)
setPositionResolver in interface RichLocationp - 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 Locationpublic boolean isContiguous()
isContiguous in interface Locationtrue if and only if this Location
contains every point from min to
max inclusive.public boolean contains(int p)
contains in interface Locationp - the point to check
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 LocationdecoratorClass - the Class to check
public Location newInstance(Location loc)
loc.
The default behavior is to return loc.
ALWAYS RETURNS PASSED LOCATION
newInstance in interface Locationloc - the Location to use as template
public Location translate(int dist)
translate in interface Locationdist - the distance to translate (to the right)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
contains in interface Locationl - the Location to check
public boolean overlaps(Location l)
Abstractly, two locations overlap if they both contain any point. ALWAYS RETURNS FALSE
overlaps in interface Locationl - the Location to check
public Location union(Location l)
union in interface Locationl - the Location to union with
public Location intersection(Location l)
intersection in interface Locationl - the Location to intersect with
public void setCrossRefResolver(CrossReferenceResolver r)
setCrossRefResolver in interface RichLocationr - the resolver to use.public SymbolList symbols(SymbolList seq)
symbols in interface Locationseq - the SymbolList to process
public int hashCode()
hashCode in class Objectpublic 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
equals in interface Locationequals in class Objecto - the Object to check
public int compareTo(Object o)
compareTo in interface Comparablepublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||