1 package org.treetank.io; 2 3 import org.treetank.exception.TTIOException; 4 5 /** 6 * Interface for Log to capsulate persistent against non-persistent logs. 7 * 8 * @author Sebastian Graf, University of Kosntanz 9 * 10 */ 11 public interface ILog { 12 13 /** 14 * Getting a {@link LogValue} for a given key 15 * 16 * @param pKey 17 * the key 18 * @return a suitable {@link LogValue} if present, false otherwise 19 * @throws TTIOException 20 */ 21 LogValue get(LogKey pKey) throws TTIOException; 22 23 /** 24 * Putting a new entry to the log, overriding already existing entries. 25 * 26 * @param pKey 27 * to be set 28 * @param pValue 29 * to be set 30 * @throws TTIOException 31 */ 32 void put(LogKey pKey, LogValue pValue) throws TTIOException; 33 34 /** 35 * Closing the log. 36 * 37 * @throws TTIOException 38 */ 39 void close() throws TTIOException; 40 41 /** 42 * Check if log is closed or not. 43 * 44 * @return if log is closed. 45 */ 46 boolean isClosed(); 47 48 }