edu.mit.jwi.data
Interface ILoadable

All Known Subinterfaces:
ILoadableDataSource<T>, IRAMDictionary
All Known Implementing Classes:
BinarySearchWordnetFile, DirectAccessWordnetFile, FileProvider, RAMDictionary, WordnetFile

public interface ILoadable

An object that can be loaded. What 'loading' means may be implementation dependent, but usually it will mean 'loaded into memory'.

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

Method Summary
 boolean isLoaded()
          Returns whether this object is loaded or not.
 void load()
          Starts a simple, non-blocking load.
 void load(boolean block)
          Initiates the loading process.
 

Method Detail

load

void load()
Starts a simple, non-blocking load. If the object is already loaded, the method returns immediately and has no effect. If the object is in the process of loading, the method also returns immediately.

Since:
JWI 2.2.0

load

void load(boolean block)
          throws java.lang.InterruptedException
Initiates the loading process. Depending on the flag, the method may return immediately (block is false), or return only when the loading process is complete. If the object is already loaded, the method returns immediately and has no effect. If the object is in the process of loading, and the method is called in blocking mode, the method blocks until loading is complete, even if that call of the method did not initiate the loading process. Some implementors of this interface may not support the immediate-return functionality.

Parameters:
block - if true, the method returns only when the loading process is complete; if false, the method returns immediately.
Throws:
java.lang.InterruptedException - if the method is blocking, and is interrupted while waiting for loading to complete
Since:
JWI 2.2.0

isLoaded

boolean isLoaded()
Returns whether this object is loaded or not. This method should return true only if the loading process has completed and the object is actually loaded; if the object is still in the process of loading, or failed to load, the method should return false.

Returns:
true if the method has completed loading; false otherwise
Since:
JWI 2.2.0


Copyright © 2007-2013 Massachusetts Institute of Technology. All Rights Reserved.