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.4.0
Author:
Mark A. Finlayson

Nested Class Summary
static class IHasLifecycle.LifecycleState
          An enum that represents the four different lifecycle states an object may be in.
static class IHasLifecycle.ObjectClosedException
          Indicates that the object was closed when some method was called requiring it to be open.
static class IHasLifecycle.ObjectOpenException
          Indicates that the object was open when some method was called requiring it to be closed.
 
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 java.io.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:
java.io.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 © 2007-2013 Massachusetts Institute of Technology. All Rights Reserved.