Class SequenceProxyView<C extends Compound>

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int countCompounds​(C... compounds)
      Returns the number of times we found a compound in the Sequence
      boolean equals​(java.lang.Object o)  
      AccessionID getAccession()
      Returns the AccessionID this location is currently bound with
      java.util.List<C> getAsList()
      Returns the Sequence as a List of compounds
      java.lang.Integer getBioEnd()
      1-indexed, inclusive.
      java.lang.Integer getBioStart()
      1-indexed, inclusive.
      C getCompoundAt​(int position)
      Returns the Compound at the given biological index
      CompoundSet<C> getCompoundSet()
      Gets the compound set used to back this Sequence
      int getIndexOf​(C compound)
      Scans through the Sequence looking for the first occurrence of the given compound
      SequenceView<C> getInverse()
      Does the right thing to get the inverse of the current Sequence.
      int getLastIndexOf​(C compound)
      Scans through the Sequence looking for the last occurrence of the given compound
      int getLength()
      Returns the length of the Sequence
      java.lang.String getSequenceAsString()
      Returns the String representation of the Sequence
      SequenceView<C> getSubSequence​(java.lang.Integer bioStart, java.lang.Integer bioEnd)
      Returns a portion of the sequence from the different positions.
      Sequence<C> getViewedSequence()  
      int hashCode()  
      java.util.Iterator<C> iterator()  
      void setBioEnd​(java.lang.Integer bioEnd)  
      void setBioStart​(java.lang.Integer bioStart)  
      • 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
    • Constructor Detail

      • SequenceProxyView

        public SequenceProxyView()
      • SequenceProxyView

        public SequenceProxyView​(Sequence<C> sequence)
      • SequenceProxyView

        public SequenceProxyView​(Sequence<C> sequence,
                                 java.lang.Integer bioStart,
                                 java.lang.Integer bioEnd)
        Main constructor for working with SequenceProxyViews
        Parameters:
        sequence - Sequence to proxy
        bioStart - Start; cannot be less than 1
        bioEnd - End; cannot be greater than the sequence length
    • Method Detail

      • getSequenceAsString

        public java.lang.String getSequenceAsString()
        Description copied from interface: Sequence
        Returns the String representation of the Sequence
        Specified by:
        getSequenceAsString in interface Sequence<C extends Compound>
      • getAsList

        public java.util.List<C> getAsList()
        Description copied from interface: Sequence
        Returns the Sequence as a List of compounds
        Specified by:
        getAsList in interface Sequence<C extends Compound>
      • equals

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

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

        public C getCompoundAt​(int position)
        Description copied from interface: Sequence
        Returns the Compound at the given 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)
        Description copied from interface: Sequence
        Scans through the Sequence looking for the first occurrence of the given compound
        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)
        Description copied from interface: Sequence
        Scans through the Sequence looking for the last occurrence of the given compound
        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()
        Description copied from interface: Sequence
        Returns the length of the Sequence
        Specified by:
        getLength in interface Sequence<C extends Compound>
      • getSubSequence

        public SequenceView<C> getSubSequence​(java.lang.Integer bioStart,
                                              java.lang.Integer bioEnd)
        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:
        bioStart - Biological index start; must be greater than 0
        bioEnd - Biological end; must be less than length + 1
        Returns:
        A SequenceView of the offset
      • iterator

        public java.util.Iterator<C> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<C extends Compound>
      • getBioStart

        public java.lang.Integer getBioStart()
        Description copied from interface: SequenceView
        1-indexed, inclusive.
        Specified by:
        getBioStart in interface SequenceView<C extends Compound>
        Returns:
        the bioStart
      • setBioStart

        public void setBioStart​(java.lang.Integer bioStart)
        Parameters:
        bioStart - the bioStart to set
      • getBioEnd

        public java.lang.Integer getBioEnd()
        Description copied from interface: SequenceView
        1-indexed, inclusive.
        Specified by:
        getBioEnd in interface SequenceView<C extends Compound>
        Returns:
        the bioEnd
      • setBioEnd

        public void setBioEnd​(java.lang.Integer bioEnd)
        Parameters:
        bioEnd - the bioEnd to set
      • countCompounds

        public int countCompounds​(C... compounds)
        Description copied from interface: Sequence
        Returns the number of times we found a compound in the Sequence
        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
      • 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>