Class Structure<T>

  • Direct Known Subclasses:
    MarvinStructure

    public abstract class Structure<T>
    extends java.lang.Object
    A molecular structure based on some particular implementation. The Structure must be definable as a String, but the actual implementation is up to the sub-class. Multiple formats are expected to be supported (e.g smiles, CTAB...)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String encodedMol  
    • Constructor Summary

      Constructors 
      Constructor Description
      Structure()
      Creates a new instance of Structure
      Structure​(java.lang.String mol)  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      abstract java.lang.String asSimpleText​(DFOperator operator)
      Format the structure as appropriate in smiles or smarts fromat, according to the search orerator (if available).
      java.lang.String getEncodedMol()
      Get the molecule in its original String form.
      abstract T getNative()
      Get the molecule in its native format Never returns null.
      abstract T getNative2D()
      Get the molecule in 2D coordinates.
      T retrieveMolecule​(java.lang.String key, java.lang.Object version)
      Retrieve a particular representation of the molecule from the store
      T[] retrieveMolecules​(java.lang.String key, java.lang.Object version)  
      void setEncodedMol​(java.lang.String encodedMol)
      Deprecated.
      void storeMolecule​(java.lang.String key, T mol, java.lang.Object version)
      Cache some particular representation of the molecule
      void storeMolecules​(java.lang.String key, T[] mols, java.lang.Object version)
      Cache some particular representation of the molecule
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • encodedMol

        protected java.lang.String encodedMol
    • Constructor Detail

      • Structure

        public Structure()
        Creates a new instance of Structure
      • Structure

        public Structure​(java.lang.String mol)
    • Method Detail

      • asSimpleText

        public abstract java.lang.String asSimpleText​(DFOperator operator)
        Format the structure as appropriate in smiles or smarts fromat, according to the search orerator (if available). ChemAxon extended smiles/smarts will be used if it is not possible to describe the structure in Daylight smiles/smarts.

        The decission on smiles vs. smarts is taken based on the operator. For perfect, similarity and superstructure type smiles is used, for other types smarts is used. If operator is not specified then smarts format is returned.

        To convert Molecule you can use also these two methods: ChemUtils.convertToSmilesRepresentation(chemaxon.struc.Molecule) and ChemUtils.convertToSmartsRepresentation(chemaxon.struc.Molecule).

        Parameters:
        operator - The search operator if it's available. It's allowed to put null here
        Returns:
        The smiles/smarts string
      • getEncodedMol

        public java.lang.String getEncodedMol()
        Get the molecule in its original String form.
        Returns:
        Value of property encodedMol.
      • setEncodedMol

        @Deprecated
        public void setEncodedMol​(java.lang.String encodedMol)
        Deprecated.
        Setter for property encodedMol. Don't use this method.
        Parameters:
        encodedMol - New value of property encodedMol.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getNative

        public abstract T getNative()
        Get the molecule in its native format Never returns null.
      • getNative2D

        public abstract T getNative2D()
        Get the molecule in 2D coordinates. If it can't be converted to 2D it should be returned in original coordinates. Never returns null.
      • storeMolecule

        public void storeMolecule​(java.lang.String key,
                                  T mol,
                                  java.lang.Object version)
        Cache some particular representation of the molecule
        Parameters:
        key - The key to use to store a particular representation of the structure
        mol - The molecule
        version - A version number for the molecule. Can be null.
      • storeMolecules

        public void storeMolecules​(java.lang.String key,
                                   T[] mols,
                                   java.lang.Object version)
        Cache some particular representation of the molecule
        Parameters:
        key - The key to use to store a particular representation of the structure
        mols - The molecules
        version - A version number for the molecule. Can be null.
      • retrieveMolecule

        public T retrieveMolecule​(java.lang.String key,
                                  java.lang.Object version)
        Retrieve a particular representation of the molecule from the store
        Parameters:
        key -
        version - The version number of the current molecule. If the version number is not the same as the one used to store the molecule then the store molecule is removed from the cache and should be re-generated using the current version (and then probably added back to the cache).
        Returns:
        The molecule from the cache. Can be null.
      • retrieveMolecules

        public T[] retrieveMolecules​(java.lang.String key,
                                     java.lang.Object version)