Class BitSequenceReader<C extends Compound>

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  BitSequenceReader.BitArrayWorker<C extends Compound>
      The logic of working with a bit has been separated out into this class to help developers create the bit data structures without having to put the code into an intermediate format and to also use the format without the need to copy this code.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int countCompounds​(C... compounds)
      Counts the number of times a compound appears in this sequence store
      boolean equals​(java.lang.Object o)  
      AccessionID getAccession()
      Returns the AccessionID this location is currently bound with
      java.util.List<C> getAsList()
      Returns this Sequence store as a List
      C getCompoundAt​(int position)
      Returns the compound at the specified biological index
      CompoundSet<C> getCompoundSet()
      Returns the compound set backing this store
      int getIndexOf​(C compound)
      Returns the first occurrence of the given compound in this store; performs a linear search
      SequenceView<C> getInverse()
      Does the right thing to get the inverse of the current Sequence.
      int getLastIndexOf​(C compound)
      Returns the last occurrence of the given compound in this store; performs a linear search
      int getLength()
      Returns the length of the sequence
      java.lang.String getSequenceAsString()
      Returns the sequence as a String
      SequenceView<C> getSubSequence​(int start, int end)
      Returns a sub sequence view
      SequenceView<C> getSubSequence​(java.lang.Integer start, java.lang.Integer end)
      Returns a portion of the sequence from the different positions.
      int hashCode()  
      java.util.Iterator<C> iterator()
      Provides basic iterable access to this class
      void setCompoundSet​(CompoundSet<C> compoundSet)
      Class is immutable & so this is unsupported
      void setContents​(java.lang.String sequence)
      Class is immutable & so this is unsupported
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • countCompounds

        public int countCompounds​(C... compounds)
        Counts the number of times a compound appears in this sequence store
        Specified by:
        countCompounds in interface Sequence<C extends Compound>
        Parameters:
        compounds - Vargs of the compounds to count
        Returns:
        Number of times a compound was found
      • getAsList

        public java.util.List<C> getAsList()
        Returns this Sequence store as a List
        Specified by:
        getAsList in interface Sequence<C extends Compound>
      • getCompoundAt

        public C getCompoundAt​(int position)
        Returns the compound at the specified biological index
        Specified by:
        getCompoundAt in interface Sequence<C extends Compound>
        Parameters:
        position - Biological index (1 to n)
        Returns:
        Compound at the specified position
      • getIndexOf

        public int getIndexOf​(C compound)
        Returns the first occurrence of the given compound in this store; performs a linear search
        Specified by:
        getIndexOf in interface Sequence<C extends Compound>
        Parameters:
        compound - Compounds to look for
        Returns:
        Index of the first position of the compound in the sequence (1 to n)
      • getLastIndexOf

        public int getLastIndexOf​(C compound)
        Returns the last occurrence of the given compound in this store; performs a linear search
        Specified by:
        getLastIndexOf in interface Sequence<C extends Compound>
        Parameters:
        compound - Compounds to look for
        Returns:
        Index of the last position of the compound in the sequence (1 to n)
      • getLength

        public int getLength()
        Returns the length of the sequence
        Specified by:
        getLength in interface Sequence<C extends Compound>
      • getSequenceAsString

        public java.lang.String getSequenceAsString()
        Returns the sequence as a String
        Specified by:
        getSequenceAsString in interface Sequence<C extends Compound>
      • getSubSequence

        public SequenceView<C> getSubSequence​(int start,
                                              int end)
        Returns a sub sequence view
      • iterator

        public java.util.Iterator<C> iterator()
        Provides basic iterable access to this class
        Specified by:
        iterator in interface java.lang.Iterable<C extends Compound>
      • getSubSequence

        public SequenceView<C> getSubSequence​(java.lang.Integer start,
                                              java.lang.Integer end)
        Description copied from interface: Sequence
        Returns a portion of the sequence from the different positions. This is indexed from 1
        Specified by:
        getSubSequence in interface Sequence<C extends Compound>
        Parameters:
        start - Biological index start; must be greater than 0
        end - Biological end; must be less than length + 1
        Returns:
        A SequenceView of the offset
      • getInverse

        public SequenceView<C> getInverse()
        Description copied from interface: Sequence
        Does the right thing to get the inverse of the current Sequence. This means either reversing the Sequence and optionally complementing the Sequence.
        Specified by:
        getInverse in interface Sequence<C extends Compound>
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object