Class ScopFactory


  • public class ScopFactory
    extends java.lang.Object
    Controls the global ScopDatabase being used.

    Defaults to a RemoteScopInstallation, which is fast for small numbers of queries. For many queries, using getSCOP(version,true) may be faster, since it makes only one network request.

    Example: Fetch the structure corresponding to an old version of scop

     ScopInstallation scop = new ScopInstallation();
     scop.setScopVersion("1.69");
     ScopFactory.setScopDatabase(scop);
     AtomCache cache = new AtomCache();
     cache.setFetchFileEvenIfObsolete(true); //fetch older PDBs
     cache.setStrictSCOP(false); // correct simple errors in domain names
     Structure s = cache.getStructure("d3hbia_");
    Author:
    sbliven
    • Constructor Detail

      • ScopFactory

        public ScopFactory()
    • Method Detail

      • getSCOP

        public static ScopDatabase getSCOP()
        Get the current default instance for the default version
        Returns:
      • getSCOP

        public static ScopDatabase getSCOP​(boolean forceLocalData)
        Parameters:
        forceLocalData - Whether to use a local installation or a remote installation
        Returns:
        See Also:
        getSCOP(String, boolean)
      • getSCOP

        public static ScopDatabase getSCOP​(java.lang.String version)
        requests a particular version of SCOP. Where possible, this will be the current default instance. Otherwise a new instance will be created.
        Parameters:
        version -
        Returns:
      • getSCOP

        public static ScopDatabase getSCOP​(java.lang.String version,
                                           boolean forceLocalData)
        Gets an instance of the specified scop version.

        The particular implementation returned is influenced by the forceLocalData parameter. When false, the instance returned will generally be a RemoteScopInstallation, although this may be influenced by previous calls to this class. When true, the result is guaranteed to implement LocalScopDatabase (generally a BerkeleyScopInstallation).

        Note that

        Parameters:
        version - A version number, such as VERSION_1_75A
        forceLocalData - Whether to use a local installation or a remote installation
        Returns:
        an
      • setScopDatabase

        public static void setScopDatabase​(java.lang.String version)
        Set the default scop version
        Parameters:
        version - A version number, such as VERSION_1_75A
      • setScopDatabase

        public static void setScopDatabase​(java.lang.String version,
                                           boolean forceLocalData)
        Set the default scop version
        Parameters:
        version - A version number, such as VERSION_1_75A
        forceLocalData - Whether to use a local installation or a remote installation
      • setScopDatabase

        public static void setScopDatabase​(ScopDatabase scop)
        Set the default scop version and instance
        Parameters:
        scop -