gmstorage.java

来自「Gmail API for Java 一个gmail信箱的客户端」· Java 代码 · 共 60 行

JAVA
60
字号
package siuying.gm.app.gmailer4j;

import java.util.*;
import siuying.gm.structure.*;
import java.io.*;

/**
 * GMStorage
 * Interface that defines method to store data object
 * different method of storage can be implemented
 */
public interface GMStorage{
    /**
     * set the url/identifer of the storage
     * depends on implementation 
     */
    public void setUrl(String url) throws NullPointerException;
    
    /**
     * open a storage
     */
    public void open() throws IOException ;
    
    /**
     * close a storage
     */
    public void close();
    
    /**
     * if an item is in storage
     */
    public boolean containsId(String id) throws NullPointerException;
    
    /**
     *get an Object from storage
     */
    public Object get(String id) throws IOException, NullPointerException;
    
    /** 
     * store an Object to storage
     */
    public void put(String id, Object item) throws IOException, NullPointerException ;
    
    /**
     * remove a thread from storage
     */
    public void remove(String id) throws IOException, NullPointerException ;
    
    /**
     * flush the storage, force save the change permanently 
     */
    public void flush() throws IOException ;
    
    /**
     * iterate through the threads in storage
     */
    public Iterator iterator();

}

⌨️ 快捷键说明

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