Class EmptyRichLocation

    • Method Detail

      • sort

        public 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. DOES NOTHING
        Specified by:
        sort in interface RichLocation
      • getNoteSet

        public Set getNoteSet()
        Returns the set of notes associated with this object. Would normally delegate call to internal RichAnnotation instance. ALWAYS RETURNS THE EMPTY ANNOTATION NOTE SET
        Specified by:
        getNoteSet in interface RichAnnotatable
        Returns:
        set a set of Note objects.
        See Also:
        Note
      • setNoteSet

        public void setNoteSet​(Set notes)
                        throws ChangeVetoException
        Clears the notes associated with this object and replaces them with the contents of this set. Would normally delegate call to internal RichAnnotation instance. NOT IMPLEMENTED
        Specified by:
        setNoteSet in interface RichAnnotatable
        Parameters:
        notes - the set of Note objects to replace the existing ones with.
        Throws:
        ChangeVetoException - if the set is null or contains any objects that are not Note objects.
        See Also:
        Note
      • 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:
        getCircularLength in interface RichLocation
        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. NOT IMPLEMENTED
        Specified by:
        setCircularLength in interface RichLocation
        Parameters:
        sourceSeqLength - the circular length of this location
        Throws:
        ChangeVetoException - if it doesn't want to change.
      • getRank

        public int getRank()
        Retrieves the rank associated with this location. ALWAYS RETURNS ZERO
        Specified by:
        getRank in interface RichLocation
        Returns:
        the rank.
      • getMax

        public int getMax()
        The maximum position contained.

        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

        Specified by:
        getMax in interface Location
        Returns:
        the maximum position contained
      • getMin

        public int getMin()
        The minimum position contained.

        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

        Specified by:
        getMin in interface Location
        Returns:
        the minimum position contained
      • setPositionResolver

        public 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.
        Specified by:
        setPositionResolver in interface RichLocation
        Parameters:
        p - the position resolver to use.
      • blockIterator

        public Iterator blockIterator()
        Return an Iterator over the set of maximal contiguous sub-locations.

        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

        Specified by:
        blockIterator in interface Location
        Returns:
        an Iterator over Location objects that are the maximally contiguous set of locations contained within this location
      • isContiguous

        public boolean isContiguous()
        Determine if a Location is contiguous. ALWAYS RETURNS TRUE
        Specified by:
        isContiguous in interface Location
        Returns:
        true if and only if this Location contains every point from min to max inclusive.
      • contains

        public boolean contains​(int p)
        Checks if this location contains a point. ALWAYS RETURNS FALSE
        Specified by:
        contains in interface Location
        Parameters:
        p - the point to check
        Returns:
        true if this contains p, otherwise false
      • getDecorator

        public Location getDecorator​(Class decoratorClass)
        Checks the decorator chain for an instance of decoratorClass and return it if found.

        The default behavior is to return null. If the current object is a decorator and is an instance of decoratorClass it should return itself. Otherwise, the decorator should chain this method onto the instance it wraps. ALWAYS RETURNS NULL

        Specified by:
        getDecorator in interface Location
        Parameters:
        decoratorClass - the Class to check
        Returns:
        a Location if an instance of this class is present in the decorator chain and null otherwise.
      • newInstance

        public 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.

        The default behavior is to return loc unchanged. If the class is a location decorator then it should instantiate an instance of the same type that decorates loc. ALWAYS RETURNS PASSED LOCATION

        Specified by:
        newInstance in interface Location
        Parameters:
        loc - the Location to use as template
        Returns:
        a Location instance based on loc with the same decorators as the current instance
      • translate

        public Location translate​(int dist)
        Create a location that is a translation of this location. ALWAYS RETURNS SELF
        Specified by:
        translate in interface Location
        Parameters:
        dist - the distance to translate (to the right)
      • contains

        public boolean contains​(Location l)
        Checks if this location contains the other.

        Abstractly, a location contains another if every point in the other location is contained within this one. ALWAYS RETURNS FALSE

        Specified by:
        contains in interface Location
        Parameters:
        l - the Location to check
        Returns:
        true if this contains l, otherwise false
      • overlaps

        public boolean overlaps​(Location l)
        Checks if these two locations overlap, using this location's concept of overlapping.

        Abstractly, two locations overlap if they both contain any point. ALWAYS RETURNS FALSE

        Specified by:
        overlaps in interface Location
        Parameters:
        l - the Location to check
        Returns:
        true if they overlap, otherwise false
      • union

        public Location union​(Location l)
        Return a Location containing all points in either ranges. ALWAYS RETURNS PASSED LOCATION
        Specified by:
        union in interface Location
        Parameters:
        l - the Location to union with
        Returns:
        a Location representing the union
      • intersection

        public Location intersection​(Location l)
        Returns a Location that contains all points common to both ranges. ALWAYS RETURNS SELF
        Specified by:
        intersection in interface Location
        Parameters:
        l - the Location to intersect with
        Returns:
        a Location containing all points common to both, or the empty range if there are no such points
      • setCrossRefResolver

        public 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. This method is ignored in the empty location because there is nothing to resolve.
        Specified by:
        setCrossRefResolver in interface RichLocation
        Parameters:
        r - the resolver to use.
      • symbols

        public SymbolList symbols​(SymbolList seq)
        Return the symbols in a sequence that fall within this range. ALWAYS RETURNS THE EMPTY SYMBOL LIST
        Specified by:
        symbols in interface Location
        Parameters:
        seq - the SymbolList to process
        Returns:
        the SymbolList containing the symbols in seq in this range
      • equals

        public boolean equals​(Object o)
        Checks if this location is equivalent to the other.

        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

        Specified by:
        equals in interface Location
        Overrides:
        equals in class Object
        Parameters:
        o - the Object to check
        Returns:
        true if this equals l, otherwise false
      • compareTo

        public int compareTo​(Object o)
        Empty Rich Locations return 0 when compared to other Empty ones, or -1 otherwise.
        Specified by:
        compareTo in interface Comparable