Class ArrayListSequenceReader<C extends Compound>
java.lang.Object
org.biojava3.core.sequence.storage.ArrayListSequenceReader<C>
- Type Parameters:
C-
- All Implemented Interfaces:
Iterable<C>,Accessioned,Sequence<C>,SequenceReader<C>
- Direct Known Subclasses:
ArrayListProxySequenceReader
public class ArrayListSequenceReader<C extends Compound>
extends Object
implements SequenceReader<C>
Stores a Sequence as a collection of compounds in an ArrayList
-
Constructor Summary
ConstructorsConstructorDescriptionArrayListSequenceReader(String sequence, CompoundSet<C> compoundSet) ArrayListSequenceReader(List<C> compounds, CompoundSet<C> compoundSet) -
Method Summary
Modifier and TypeMethodDescriptionintcountCompounds(C... compounds) Returns the number of times we found a compound in the SequencebooleanReturns the AccessionID this location is currently bound withReturns the Sequence as a List of compoundsgetCompoundAt(int position) Returns the Compound at the given biological indexGets the compound set used to back this SequenceintgetIndexOf(C compound) Scans through the Sequence looking for the first occurrence of the given compoundDoes the right thing to get the inverse of the current Sequence.intgetLastIndexOf(C compound) Scans through the Sequence looking for the last occurrence of the given compoundintReturns the length of the SequenceReturns the String representation of the SequencegetSequenceAsString(Integer begin, Integer end, Strand strand) getSubSequence(Integer bioBegin, Integer bioEnd) Returns a portion of the sequence from the different positions.inthashCode()iterator()voidsetCompoundSet(CompoundSet<C> compoundSet) voidsetContents(String sequence) voidsetContents(List<C> list) Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ArrayListSequenceReader
public ArrayListSequenceReader() -
ArrayListSequenceReader
- Parameters:
compounds-compoundSet-
-
ArrayListSequenceReader
- Parameters:
sequence-compoundSet-
-
-
Method Details
-
getSequenceAsString
Description copied from interface:SequenceReturns the String representation of the Sequence- Specified by:
getSequenceAsStringin interfaceSequence<C extends Compound>- Returns:
-
getSequenceAsString
- Parameters:
begin-end-strand-- Returns:
-
getAsList
Description copied from interface:SequenceReturns the Sequence as a List of compounds -
getCompoundAt
Description copied from interface:SequenceReturns the Compound at the given biological index- Specified by:
getCompoundAtin interfaceSequence<C extends Compound>- Parameters:
position-- Returns:
-
getIndexOf
Description copied from interface:SequenceScans through the Sequence looking for the first occurrence of the given compound- Specified by:
getIndexOfin interfaceSequence<C extends Compound>- Parameters:
compound-- Returns:
-
getLastIndexOf
Description copied from interface:SequenceScans through the Sequence looking for the last occurrence of the given compound- Specified by:
getLastIndexOfin interfaceSequence<C extends Compound>- Parameters:
compound-- Returns:
-
getLength
public int getLength()Description copied from interface:SequenceReturns the length of the Sequence -
iterator
-
setCompoundSet
- Specified by:
setCompoundSetin interfaceSequenceReader<C extends Compound>- Parameters:
compoundSet-
-
getCompoundSet
Description copied from interface:SequenceGets the compound set used to back this Sequence- Specified by:
getCompoundSetin interfaceSequence<C extends Compound>- Returns:
-
setContents
- Specified by:
setContentsin interfaceSequenceReader<C extends Compound>- Parameters:
sequence-
-
setContents
- Parameters:
list-
-
getSubSequence
Description copied from interface:SequenceReturns a portion of the sequence from the different positions. This is indexed from 1- Specified by:
getSubSequencein interfaceSequence<C extends Compound>- Parameters:
bioBegin-bioEnd-- Returns:
-
getAccession
Description copied from interface:AccessionedReturns the AccessionID this location is currently bound with- Specified by:
getAccessionin interfaceAccessioned- Returns:
-
countCompounds
Description copied from interface:SequenceReturns the number of times we found a compound in the Sequence- Specified by:
countCompoundsin interfaceSequence<C extends Compound>- Parameters:
compounds-- Returns:
-
getInverse
Description copied from interface:SequenceDoes the right thing to get the inverse of the current Sequence. This means either reversing the Sequence and optionally complementing the Sequence.- Specified by:
getInversein interfaceSequence<C extends Compound>- Returns:
-
hashCode
public int hashCode() -
equals
-