ur_rna.StructureEditor.models

## Class Strand

- java.lang.Object
- - java.util.AbstractCollection<E>
  - - java.util.AbstractList<Nuc>
    - - ur_rna.StructureEditor.models.Strand

- All Implemented Interfaces:
    java.lang.Iterable<Nuc>, java.util.Collection<Nuc>, java.util.List<Nuc>, INucGroup

      public class Strand
      extends java.util.AbstractList<Nuc>
      implements INucGroup

  A Strand represents a single RNA strand. An RNA drawing could potentially contain multiple strands, and the strands can each contain inter-molecular connections (e.g. base pairs) to other strands.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) int` | `index`
    `(package private) int` | `offset`
    `protected StrandList` | `owner`
    `private RnaScene` | `scene`
    `(package private) int` | `size`
    `protected java.util.List<Nuc>` | `source`

    - ### Fields inherited from class java.util.AbstractList

      `modCount`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Strand(RnaScene scene, StrandList owner, int index, java.util.List<Nuc> nucs, int offset, int size)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Nuc` | `add()`
    `void` | `add(int index, Nuc element)`
    `Nuc` | `add(java.lang.String symbol)`
    `java.util.List<Nuc>` | `addAll(java.lang.CharSequence sequence)`
    `boolean` | `addAll(java.util.Collection<? extends Nuc> c)`
    `java.util.List<Nuc>` | `addAll(int index, java.lang.CharSequence sequence)`
    `boolean` | `addAll(int index, java.util.Collection<? extends Nuc> c)`
    `java.util.List<Nuc>` | `addPlaceholders(int count)`
    `java.util.List<Nuc>` | `addPlaceholders(int index, int count)`
    `void` | `clear()`
    `Nuc` | `first()`
    `Nuc` | `get(int index)`
    `java.util.Collection<Nuc>` | `getBases()` Implements `INucGroup.getBases()`
    `(package private) int` | `getEnd()` Get the scene index of the last nucleotide in this strand plus one.
    `int` | `getIndex()` Get the index of this strand in the list of RnaScene strands.
    `Nuc` | `getNext(Nuc nuc)`
    `Nuc` | `getNext(Nuc nuc, int steps)`
    `Nuc` | `getNextInScene(Nuc nuc, int steps, boolean loopToBeginning)` Returns the next nucleotide after the specified one, regardless of whether it is in this strand or another one.
    `Nuc` | `getPrev(Nuc nuc)`
    `RnaScene` | `getScene()`
    `int` | `getSceneEnd()` Get the index (relative to all nucleotides in the scene) immediately AFTER last nucleotide in this Strand
    `int` | `getSceneStart()` Get the index (relative to all nucleotides in the scene) of the first nucleotide in this Strand
    `java.util.Iterator<Nuc>` | `iterator()` Returns an iterator over all Nucletotides in the group.
    `Nuc` | `last()`
    `java.util.ListIterator<Nuc>` | `listIterator(int startIndex)`
    `protected java.lang.String` | `outOfBoundsMsg(int index)`
    `protected void` | `rangeCheck(int index)`
    `protected void` | `rangeCheckForAdd(int index)`
    `Nuc` | `remove(int index)`
    `boolean` | `removeAll(java.util.Collection<?> c)`
    `boolean` | `retainAll(java.util.Collection<?> c)`
    `int` | `sceneToStrandIndex(int nucIndexInScene)`
    `Nuc` | `set(int index, Nuc element)`
    `(package private) void` | `setEnd(int end)`
    `int` | `size()`
    `int` | `strandToSceneIndex(int nucIndexInStrand)`
    `private java.lang.UnsupportedOperationException` | `unsupported()`

    - ### Methods inherited from class java.util.AbstractList

      `add, equals, hashCode, indexOf, lastIndexOf, listIterator, removeRange, subList`

    - ### Methods inherited from class java.util.AbstractCollection

      `contains, containsAll, isEmpty, remove, toArray, toArray, toString`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface ur_rna.StructureEditor.models.INucGroup

      `transformAll`

    - ### Methods inherited from interface java.lang.Iterable

      `forEach, spliterator`

    - ### Methods inherited from interface java.util.List

      `contains, containsAll, isEmpty, remove, replaceAll, sort, spliterator, toArray, toArray`

    - ### Methods inherited from interface java.util.Collection

      `parallelStream, removeIf, stream`

- - ### Field Detail

    - #### index

          int index

    - #### offset

          int offset

    - #### owner

          protected final StrandList owner

    - #### scene

          private RnaScene scene

    - #### size

          int size

    - #### source

          protected final java.util.List<Nuc> source

  - ### Constructor Detail

    - #### Strand

          Strand(RnaScene scene,
                 StrandList owner,
                 int index,
                 java.util.List<Nuc> nucs,
                 int offset,
                 int size)

  - ### Method Detail

    - #### add

          public Nuc add()

    - #### add

          public void add(int index,
                          Nuc element)

      Specified by:
        `add` in interface `java.util.List<Nuc>`
      Overrides:
        `add` in class `java.util.AbstractList<Nuc>`

    - #### add

          public Nuc add(java.lang.String symbol)

    - #### addAll

          public java.util.List<Nuc> addAll(java.lang.CharSequence sequence)

    - #### addAll

          public boolean addAll(java.util.Collection<? extends Nuc> c)

      Specified by:
        `addAll` in interface `java.util.Collection<Nuc>`
      Specified by:
        `addAll` in interface `java.util.List<Nuc>`
      Overrides:
        `addAll` in class `java.util.AbstractCollection<Nuc>`

    - #### addAll

          public java.util.List<Nuc> addAll(int index,
                                            java.lang.CharSequence sequence)

    - #### addAll

          public boolean addAll(int index,
                                java.util.Collection<? extends Nuc> c)

      Specified by:
        `addAll` in interface `java.util.List<Nuc>`
      Overrides:
        `addAll` in class `java.util.AbstractList<Nuc>`

    - #### addPlaceholders

          public java.util.List<Nuc> addPlaceholders(int count)

    - #### addPlaceholders

          public java.util.List<Nuc> addPlaceholders(int index,
                                                     int count)

    - #### clear

          public void clear()

      Specified by:
        `clear` in interface `java.util.Collection<Nuc>`
      Specified by:
        `clear` in interface `java.util.List<Nuc>`
      Overrides:
        `clear` in class `java.util.AbstractList<Nuc>`

    - #### first

          public Nuc first()

    - #### get

          public Nuc get(int index)

      Specified by:
        `get` in interface `java.util.List<Nuc>`
      Specified by:
        `get` in class `java.util.AbstractList<Nuc>`

    - #### getBases

          public java.util.Collection<Nuc> getBases()

      Implements `INucGroup.getBases()`
      Specified by:
        `getBases` in interface `INucGroup`
      Returns:
        a Collection of nucleotides.

    - #### getEnd

          int getEnd()

      Get the scene index of the last nucleotide in this strand plus one. I.e. the index just beyond this strand: `offset+size`

    - #### getIndex

          public int getIndex()

      Get the index of this strand in the list of RnaScene strands.

    - #### getNext

          public Nuc getNext(Nuc nuc)

    - #### getNext

          public Nuc getNext(Nuc nuc,
                             int steps)

    - #### getNextInScene

          public Nuc getNextInScene(Nuc nuc,
                                    int steps,
                                    boolean loopToBeginning)

      Returns the next nucleotide after the specified one, regardless of whether it is in this strand or another one. If the resulting index is greater than the number of nucleotides, null will be returned, unless loopToBeginning is true, in which case the scene is considered to be a circuit and numbering continues at the beginning (i.e. the next Nuc after the last Nuc is the first Nuc etc).

    - #### getPrev

          public Nuc getPrev(Nuc nuc)

    - #### getScene

          public RnaScene getScene()

    - #### getSceneEnd

          public int getSceneEnd()

      Get the index (relative to all nucleotides in the scene) immediately AFTER last nucleotide in this Strand

    - #### getSceneStart

          public int getSceneStart()

      Get the index (relative to all nucleotides in the scene) of the first nucleotide in this Strand

    - #### iterator

          public java.util.Iterator<Nuc> iterator()

      Description copied from interface: `INucGroup`
      Returns an iterator over all Nucletotides in the group.
      Specified by:
        `iterator` in interface `java.lang.Iterable<Nuc>`
      Specified by:
        `iterator` in interface `java.util.Collection<Nuc>`
      Specified by:
        `iterator` in interface `java.util.List<Nuc>`
      Specified by:
        `iterator` in interface `INucGroup`
      Overrides:
        `iterator` in class `java.util.AbstractList<Nuc>`
      Returns:
        an Iterator.

    - #### last

          public Nuc last()

    - #### listIterator

          public java.util.ListIterator<Nuc> listIterator(int startIndex)

      Specified by:
        `listIterator` in interface `java.util.List<Nuc>`
      Overrides:
        `listIterator` in class `java.util.AbstractList<Nuc>`

    - #### outOfBoundsMsg

          protected java.lang.String outOfBoundsMsg(int index)

    - #### rangeCheck

          protected void rangeCheck(int index)

    - #### rangeCheckForAdd

          protected void rangeCheckForAdd(int index)

    - #### remove

          public Nuc remove(int index)

      Specified by:
        `remove` in interface `java.util.List<Nuc>`
      Overrides:
        `remove` in class `java.util.AbstractList<Nuc>`

    - #### removeAll

          public boolean removeAll(java.util.Collection<?> c)

      Specified by:
        `removeAll` in interface `java.util.Collection<Nuc>`
      Specified by:
        `removeAll` in interface `java.util.List<Nuc>`
      Overrides:
        `removeAll` in class `java.util.AbstractCollection<Nuc>`

    - #### retainAll

          public boolean retainAll(java.util.Collection<?> c)

      Specified by:
        `retainAll` in interface `java.util.Collection<Nuc>`
      Specified by:
        `retainAll` in interface `java.util.List<Nuc>`
      Overrides:
        `retainAll` in class `java.util.AbstractCollection<Nuc>`

    - #### sceneToStrandIndex

          public int sceneToStrandIndex(int nucIndexInScene)

    - #### set

          public Nuc set(int index,
                         Nuc element)

      Specified by:
        `set` in interface `java.util.List<Nuc>`
      Overrides:
        `set` in class `java.util.AbstractList<Nuc>`

    - #### setEnd

          void setEnd(int end)

    - #### size

          public int size()

      Specified by:
        `size` in interface `java.util.Collection<Nuc>`
      Specified by:
        `size` in interface `java.util.List<Nuc>`
      Specified by:
        `size` in class `java.util.AbstractCollection<Nuc>`

    - #### strandToSceneIndex

          public int strandToSceneIndex(int nucIndexInStrand)

    - #### unsupported

          private java.lang.UnsupportedOperationException unsupported()