Class BitSequenceReader.BitArrayWorker<C extends Compound>

java.lang.Object
org.biojava3.core.sequence.storage.BitSequenceReader.BitArrayWorker<C>
Type Parameters:
C - The Compound to use
Direct Known Subclasses:
FourBitSequenceReader.FourBitArrayWorker, TwoBitSequenceReader.TwoBitArrayWorker
Enclosing class:
BitSequenceReader<C extends Compound>

public abstract static class BitSequenceReader.BitArrayWorker<C extends Compound> extends Object
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. This class behaves just like a Sequence without the interface
Author:
ayates
  • Field Details

  • Constructor Details

    • BitArrayWorker

      public BitArrayWorker(Sequence<C> sequence)
    • BitArrayWorker

      public BitArrayWorker(String sequence, CompoundSet<C> compoundSet)
    • BitArrayWorker

      public BitArrayWorker(CompoundSet<C> compoundSet, int length)
    • BitArrayWorker

      public BitArrayWorker(CompoundSet<C> compoundSet, int[] sequence)
  • Method Details

    • seqArraySize

      public int seqArraySize(int length)
    • populate

      public void populate(Sequence<C> sequence)
      Loops through the Compounds in a Sequence and passes them onto setCompoundAt(Compound, int)
    • populate

      public void populate(String sequence)
      Loops through the chars in a String and passes them onto setCompoundAt(char, int)
    • setCompoundAt

      public void setCompoundAt(char base, int position)
      Converts from char to Compound and sets it at the given biological index
    • setCompoundAt

      public void setCompoundAt(C compound, int position)
      Sets the compound at the specified biological index
    • getCompoundAt

      public C getCompoundAt(int position)
      Returns the compound at the specified biological index
    • getCompoundSet

      public CompoundSet<C> getCompoundSet()
      Returns the compound set backing this store
    • getLength

      public int getLength()
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object