Class JoiningSequenceReader<C extends Compound>

  • Type Parameters:
    C - Tyoe of compound to hold
    All Implemented Interfaces:
    Iterable<C>, Accessioned, ProxySequenceReader<C>, Sequence<C>, SequenceReader<C>

    public class JoiningSequenceReader<C extends Compound>
    extends Object
    implements ProxySequenceReader<C>
    This reader actually proxies onto multiple types of sequence in order to allow a number of sequence objects to act as if they are one sequence. The code takes in any number of sequences, records the minimum and maximum bounds each sequence covers with respect to 1 position indexing and then binary searches these when a position is requested. Because of this 0 length Sequences are excluded during construction. Performance is not as good as if you are using a flat sequence however the speed of lookup is more than adaquate for most situations. Using the iterator gives the best performance as this does not rely on the binary search mechanism instead iterating through each sequence in turn.