edu.mit.jwi.data
Interface IHasLifecycle

All Superinterfaces:
IClosable
All Known Subinterfaces:
ICachingDictionary, ICachingDictionary.IItemCache, IDataProvider, IDataSource<T>, IDataSourceDictionary, IDictionary, ILoadableDataSource<T>, IRAMDictionary
All Known Implementing Classes:
BinarySearchWordnetFile, CachingDictionary, CachingDictionary.ItemCache, DataSourceDictionary, Dictionary, DirectAccessWordnetFile, FileProvider, RAMDictionary, WordnetFile

public interface IHasLifecycle
extends IClosable

Object that has a lifecycle. Objects implementing this interface can be opened, closed, and have their open state queried. In general, the open state of the object should be reversible, that is, an object may be closed and re-opened. What happens when the object is used when closed is implementation dependent.

Since:
JWI 2.2.0
Version:
2.2.2
Author:
Mark A. Finlayson

Nested Class Summary
static class IHasLifecycle.ObjectClosedException
          Indicates that the object was not open when some method was called requiring it to be open.
 
Method Summary
 boolean isOpen()
          Returns true if the dictionary is open, that is, ready to accept queries; returns false otherwise
 boolean open()
          This opens the object by performing any required initialization steps.
 
Methods inherited from interface edu.mit.jwi.data.IClosable
close
 

Method Detail

open

boolean open()
             throws IOException
This opens the object by performing any required initialization steps. If this method returns false, then subsequent calls to isOpen() will return false.

Returns:
true if there were no errors in initialization; false otherwise.
Throws:
IOException - if there was IO error while performing initializataion
Since:
JWI 2.2.0

isOpen

boolean isOpen()
Returns true if the dictionary is open, that is, ready to accept queries; returns false otherwise

Returns:
true if the object is open; false otherwise
Since:
JWI 2.2.0


Copyright © 2011. All Rights Reserved.