storagefactory.java

来自「这个是perst-269.zip下面的SOURCECODE,和大家分享了。」· Java 代码 · 共 28 行

JAVA
28
字号
package org.garret.perst;
import org.garret.perst.impl.*;

/**
 * Storage factory
 */
public class StorageFactory {
    /**
     * Create new instance of the storage
     * @return new instance of the storage (unopened, you should explicitely invoke open method)
     */
    public Storage createStorage() {
        return new StorageImpl();
    }

    /**
     * Get instance of storage factory.
     * So new storages should be create in application in the following way:
     * <code>StorageFactory.getInstance().createStorage()</code>
     * @return instance of the storage factory
     */
    public static StorageFactory getInstance() { 
        return instance;
    }

    protected static final StorageFactory instance = new StorageFactory();
};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?