edu.mit.jwi.data
Interface ILoadPolicy

All Known Subinterfaces:
IRAMDictionary
All Known Implementing Classes:
FileProvider, RAMDictionary

public interface ILoadPolicy

An object with a load policy. Usually objects that implement this interface also implement the ILoadable interface, but not always. A load policy specifies what happens when the object is instantiated or initialized. Load policies are implemented as bit flags rather than enum objects (or something else) so as to allow policies to indicate a number of possible permitted loading behaviors.

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

Field Summary
static int BACKGROUND_LOAD
          Loading behavior where the object loads itself in the background when instantiated, initialized, or opened.
static int IMMEDIATE_LOAD
          Loading behavior where the object loads itself when instantiated, initialized, or opened, blocking the method.
static int NO_LOAD
          Loading behavior where the object does not load itself when instantiated, initialized, or opened.
 
Method Summary
 int getLoadPolicy()
          Returns the load policy for this object, expressed as an integer.
 void setLoadPolicy(int policy)
          Sets the load policy for this object.
 

Field Detail

NO_LOAD

static final int NO_LOAD
Loading behavior where the object does not load itself when instantiated, initialized, or opened. Loading can be initiated through other means (e.g., a call to the ILoadable.load(boolean) method, if the object supports it). Value is 1 << 1.

Since:
JWI 2.2.0
See Also:
Constant Field Values

BACKGROUND_LOAD

static final int BACKGROUND_LOAD
Loading behavior where the object loads itself in the background when instantiated, initialized, or opened. Value is 1 << 2.

Since:
JWI 2.2.0
See Also:
Constant Field Values

IMMEDIATE_LOAD

static final int IMMEDIATE_LOAD
Loading behavior where the object loads itself when instantiated, initialized, or opened, blocking the method. Value is 1 << 3.

Since:
JWI 2.2.0
See Also:
Constant Field Values
Method Detail

setLoadPolicy

void setLoadPolicy(int policy)
Sets the load policy for this object. If the object is currently loaded, or in the process of loading, the load policy will not take effect until the next time objet is instantiated, initialized, or opened.

Parameters:
policy - the policy to implement; may be one of NO_LOAD, BACKGROUND_LOAD, IMMEDIATE_LOAD or an implementation-dependent value.
Since:
JWI 2.2.0

getLoadPolicy

int getLoadPolicy()
Returns the load policy for this object, expressed as an integer.

Returns:
the load policy for this object
Since:
JWI 2.2.0


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