Class OrganicMoleculeBuilder.Substituent

  • Enclosing class:
    OrganicMoleculeBuilder

    public static final class OrganicMoleculeBuilder.Substituent
    extends java.lang.Object
    Helps represent, build, and attach substituents to the backbone. You do not need to use this class.
    • Constructor Detail

      • Substituent

        public Substituent()
    • Method Detail

      • getValenceConsumed

        public int getValenceConsumed()
        How many bonds this substituent consumes on the backbone carbon it's attached to.
        Returns:
        The number of bonds used to connect to this substituent.
      • attach

        public BondedAtom attach​(BondedAtom coreCarbon)
        Builds the substituent and attaches it to the backbone.
        Parameters:
        coreCarbon - The core carbon bonded to the substituent.
        Returns:
        The first atom of the substituent.
      • getAlkylLength

        public int getAlkylLength()
        Gets how long this alkyl substituent is.
        Returns:
        The number of carbons.
      • getHalogen

        public ChemicalElement getHalogen()
        Gets what halogen element this substituent is.
        Returns:
        The chemical element.
      • createAlkyl

        public static OrganicMoleculeBuilder.Substituent createAlkyl​(int length)
        Creates an alkyl substituent.
        Parameters:
        length - How many carbons in the alkyl chain.
        Returns:
        The new substituent.
      • createAlcohol

        public static OrganicMoleculeBuilder.Substituent createAlcohol​(int protonation)
        Creates an (optionally charged) alcohol substituent.
        Parameters:
        protonation - The number of protons on the O, from zero to two.
        Returns:
        The new substituent.