ur_rna.StructureEditor.models

## Class Nuc

- java.lang.Object
- - ur_rna.StructureEditor.models.Nuc

- All Implemented Interfaces:
    java.lang.Cloneable, java.lang.Comparable<Nuc>, java.lang.Iterable<Nuc>, INucGroup

      public class Nuc
      extends java.lang.Object
      implements java.lang.Cloneable, INucGroup, java.lang.Comparable<Nuc>

  Represents a single nucleotide.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) int` | `indexInScene` Stores the index of the nucleotide within the full scene.
    `java.awt.geom.Point2D.Float` | `location`
    `int` | `number`
    `(package private) Bond` | `pair`
    `(package private) Strand` | `strand`
    `NucStyle` | `style`
    `java.lang.String` | `symbol`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Nuc()`
    `Nuc(java.lang.String symbol)`
    `Nuc(java.lang.String symbol, float x, float y)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Nuc` | `clone()`
    `static int` | `compare(Nuc lhs, Nuc rhs)` Compares based on index in scene.
    `int` | `compareTo(Nuc other)` Compares based on index in scene.
    `java.util.Set<Nuc>` | `getBases()` Implementation of `INucGroup.getBases()`
    `Motif.Branch` | `getBranch()`
    `Motif.Domain` | `getDomain()`
    `Motif.Helix` | `getHelix()`
    `Motif.Loop` | `getLoop()`
    `Motif.MultiLoop` | `getMultiLoop(int minimumBranches, boolean includeExterior)`
    `Nuc` | `getNext()`
    `Nuc` | `getNext(int steps)`
    `Bond` | `getPairBond()`
    `Nuc` | `getPaired()`
    `Nuc` | `getPaired(boolean includePseudo)`
    `Nuc` | `getPrev()`
    `RnaScene` | `getScene()`
    `Strand` | `getStrand()`
    `int` | `getStrandIndex()`
    `int` | `indexInScene()` Gets the overall index of this nucleotide, including all nucleotides in previous strands.
    `int` | `indexInScene(int[] strandIndexes)` Gets the overall index of this nucleotide, given the starting indices for each strand as specified in strandIndexes For example: strandIndexes = int[] { 1, 20, 100 } for a Nuc with index=0 in the first strand, indexInScene would return 1.
    `int` | `indexInStrand()`
    `boolean` | `isPaired()`
    `boolean` | `isPaired(boolean includePseudo)`
    `Nuc` | `nextInScene()`
    `Nuc` | `nextInScene(int steps, boolean loopToBeginning)`
    `NucStyle` | `style()` Returns the style for this nucleotide, creating a new one if necessary.
    `java.lang.String` | `toString()` Returns a string representation of the object.
    `java.lang.String` | `toString(java.lang.String format)`
    `void` | `transform(java.awt.geom.AffineTransform tr)`
    `void` | `transformAll(java.awt.geom.AffineTransform tr)` Implementation of `INucGroup.transformAll(AffineTransform)`
    `void` | `translate(float dx, float dy)`

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

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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

      `iterator`

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

      `forEach, spliterator`

- - ### Field Detail

    - #### indexInScene

          transient int indexInScene

      Stores the index of the nucleotide within the full scene.

    - #### location

          public java.awt.geom.Point2D.Float location

    - #### number

          public int number

    - #### pair

          Bond pair

    - #### strand

          transient Strand strand

    - #### style

          public NucStyle style

    - #### symbol

          public java.lang.String symbol

  - ### Constructor Detail

    - #### Nuc

          public Nuc()

    - #### Nuc

          public Nuc(java.lang.String symbol)

    - #### Nuc

          public Nuc(java.lang.String symbol,
                     float x,
                     float y)

  - ### Method Detail

    - #### clone

          public Nuc clone()

      Overrides:
        `clone` in class `java.lang.Object`

    - #### compare

          public static int compare(Nuc lhs,
                                    Nuc rhs)

      Compares based on index in scene. Returns -1 if lhs comes before rhs, 0 if they are at the same index, or 1 if lhs comes after rhs.

    - #### compareTo

          public int compareTo(Nuc other)

      Compares based on index in scene. Returns -1 if this Nuc comes before other, 0 if they are at the same index, or 1 if this Nuc comes after other.
      Specified by:
        `compareTo` in interface `java.lang.Comparable<Nuc>`

    - #### getBases

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

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

    - #### getBranch

          public Motif.Branch getBranch()

    - #### getDomain

          public Motif.Domain getDomain()

    - #### getHelix

          public Motif.Helix getHelix()

    - #### getLoop

          public Motif.Loop getLoop()

    - #### getMultiLoop

          public Motif.MultiLoop getMultiLoop(int minimumBranches,
                                              boolean includeExterior)

    - #### getNext

          public Nuc getNext()

      Returns:
        The next nucleotide in this strand, or null if this is the last (3') nucleotide.

    - #### getNext

          public Nuc getNext(int steps)

      Returns:
        The nucleotide in this strand that is the specified number of nucleotides (steps) away from this one. A negative number of steps will return nucleotides before this one in the strand, while a positive number will return nucleotides after this one.

    - #### getPairBond

          public Bond getPairBond()

    - #### getPaired

          public Nuc getPaired()

    - #### getPaired

          public Nuc getPaired(boolean includePseudo)

    - #### getPrev

          public Nuc getPrev()

      Returns:
        The previous nucleotide in this strand, or null if this is the first (5') nucleotide.

    - #### getScene

          public RnaScene getScene()

    - #### getStrand

          public Strand getStrand()

    - #### getStrandIndex

          public int getStrandIndex()

    - #### indexInScene

          public int indexInScene()

      Gets the overall index of this nucleotide, including all nucleotides in previous strands.

    - #### indexInScene

          public int indexInScene(int[] strandIndexes)

      Gets the overall index of this nucleotide, given the starting indices for each strand as specified in strandIndexes For example: strandIndexes = int[] { 1, 20, 100 } for a Nuc with index=0 in the first strand, indexInScene would return 1. for a Nuc with index=5 in the second strand, indexInScene would return 25. for a Nuc with index=2 in the third strand, indexInScene would return 102.

    - #### indexInStrand

          public int indexInStrand()

    - #### isPaired

          public boolean isPaired()

    - #### isPaired

          public boolean isPaired(boolean includePseudo)

    - #### nextInScene

          public Nuc nextInScene()

    - #### nextInScene

          public Nuc nextInScene(int steps,
                                 boolean loopToBeginning)

    - #### style

          @NotNull
          public NucStyle style()

      Returns the style for this nucleotide, creating a new one if necessary.

    - #### toString

          public java.lang.String toString()

      Returns a string representation of the object. In general, the `toString` method returns a string that "textually represents" this object. The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.

      The `toString` method for class `Object` returns a string consisting of the name of the class of which the object is an instance, the at-sign character ``@`', and the unsigned hexadecimal representation of the hash code of the object. In other words, this method returns a string equal to the value of:

      >      getClass().getName() + '@' + Integer.toHexString(hashCode())

      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        a string representation of the object.

    - #### toString

          public java.lang.String toString(java.lang.String format)

    - #### transform

          public void transform(java.awt.geom.AffineTransform tr)

    - #### transformAll

          public void transformAll(java.awt.geom.AffineTransform tr)

      Implementation of `INucGroup.transformAll(AffineTransform)`
      Specified by:
        `transformAll` in interface `INucGroup`

    - #### translate

          public void translate(float dx,
                                float dy)