Package org.biojava.bio.symbol
Class MergeLocation
- java.lang.Object
-
- org.biojava.bio.symbol.AbstractLocation
-
- org.biojava.bio.symbol.AbstractRangeLocation
-
- org.biojava.bio.symbol.RangeLocation
-
- org.biojava.bio.symbol.MergeLocation
-
- All Implemented Interfaces:
Serializable
,Location
public class MergeLocation extends RangeLocation
Produced by LocationTools as a result of union operations. It's aRangeLocation
and can be used as such but it also retains knowledge of which individual components made it up. None of the methods of RangeLocation are overridden only new methods have been added to get the subcomponents.For example a union operation between the following locations [1,20],[27,45],[30-70] will produce a
CompoundLocation
like this: {[1,20],[27,70]}, the last two locations have been merged into aMergeLocation
which contains the two subcomponents.Copyright: Copyright (c) 2002
Company: AgResearch
- Version:
- 1.0
- Author:
- Mark Schreiber, Francois Pepin
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.biojava.bio.symbol.Location
empty, full, naturalOrder
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ListIterator
componentLocationIterator()
List
getComponentList(boolean recurse)
Gets the component locations that make up this onestatic MergeLocation
mergeLocations(List componentLocations)
Static Factory method for getting an instance of aMergeLocation
static MergeLocation
mergeLocations(Location locA, Location locB)
-
Methods inherited from class org.biojava.bio.symbol.RangeLocation
getMax, getMin, toString, translate
-
Methods inherited from class org.biojava.bio.symbol.AbstractRangeLocation
blockIterator, contains, isContiguous, symbols
-
Methods inherited from class org.biojava.bio.symbol.AbstractLocation
contains, equals, getDecorator, hashCode, intersection, newInstance, overlaps, union
-
-
-
-
Method Detail
-
getComponentList
public List getComponentList(boolean recurse)
Gets the component locations that make up this one- Parameters:
recurse
- if true the method lists the component locations of all nestedMergedLocation
s.- Returns:
- a
List
ofLocation
s.
-
componentLocationIterator
public ListIterator componentLocationIterator()
- Returns:
- A
ListIterator
over the component locations. The iterator does not recurse nested MergeLocations.
-
mergeLocations
public static MergeLocation mergeLocations(List componentLocations) throws BioException
Static Factory method for getting an instance of aMergeLocation
- Parameters:
componentLocations
- theLocations to Merge
- Returns:
- the merged location
- Throws:
BioException
- if the list contains objects that are notLocations
or if the locations don't represent a contiguous block. UseLocationTools.union()
if you want to merge discontinuous blocks.
-
mergeLocations
public static MergeLocation mergeLocations(Location locA, Location locB) throws BioException
- Throws:
BioException
-
-