Class Orbit

java.lang.Object
org.openscience.cdk.signature.Orbit
All Implemented Interfaces:
Cloneable, Iterable<Integer>

public class Orbit extends Object implements Iterable<Integer>, Cloneable
A list of atom indices, and the label of the orbit.
Author:
maclean
Source code:
main
Belongs to CDK module:
signature
  • Constructor Details

    • Orbit

      public Orbit(String label, int height)
      Parameters:
      label -
      height -
  • Method Details

    • iterator

      public Iterator<Integer> iterator()
      Specified by:
      iterator in interface Iterable<Integer>
    • clone

      public Object clone()
      Overrides:
      clone in class Object
    • sort

      public void sort()
      Sorts the atom indices in this orbit.
    • getHeight

      public int getHeight()
      Gets the height of the signature label.
      Returns:
      the height of the signature of this orbit
    • getAtomIndices

      public List<Integer> getAtomIndices()
      Gets all the atom indices as a list.
      Returns:
      the atom indices
    • addAtom

      public void addAtom(int atomIndex)
      Adds an atom index to the orbit.
      Parameters:
      atomIndex - the atom index
    • hasLabel

      public boolean hasLabel(String otherLabel)
      Checks to see if the orbit has this string as a label.
      Parameters:
      otherLabel - the label to compare with
      Returns:
      true if it has this label
    • isEmpty

      public boolean isEmpty()
      Checks to see if the orbit is empty.
      Returns:
      true if there are no atom indices in the orbit
    • getFirstAtom

      public int getFirstAtom()
      Gets the first atom index of the orbit.
      Returns:
      the first atom index
    • remove

      public void remove(int atomIndex)
      Removes an atom index from the orbit.
      Parameters:
      atomIndex - the atom index to remove
    • getLabel

      public String getLabel()
      Gets the label of the orbit.
      Returns:
      the orbit's string label
    • contains

      public boolean contains(int atomIndex)
      Checks to see if the orbit contains this atom index.
      Parameters:
      atomIndex - the atom index to look for
      Returns:
      true if the orbit contains this atom index
    • toString

      public String toString()
      Overrides:
      toString in class Object