AMETAS.util.context
Class AMETASContextRetrievePolicy

java.lang.Object
  extended byAMETAS.util.context.AMETASContextRetrievePolicy
All Implemented Interfaces:
AMETASRetrievePolicy

public class AMETASContextRetrievePolicy
extends java.lang.Object
implements AMETASRetrievePolicy

Determines preferences on retrieving messages. This implementation utilizes a list of context IDs. Earlier IDs are preferred.

Since:
2.6.0

Field Summary
 
Fields inherited from interface AMETAS.util.context.AMETASRetrievePolicy
NONE_SELECTED
 
Constructor Summary
AMETASContextRetrievePolicy(int[] anContextPref)
          Constructor.
 
Method Summary
 int selectMessage(java.util.List llMess)
          Selects one message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AMETASContextRetrievePolicy

public AMETASContextRetrievePolicy(int[] anContextPref)
Constructor.

Parameters:
anContextPref - List of context IDs.
Method Detail

selectMessage

public int selectMessage(java.util.List llMess)
Selects one message. The given list remains unchanged.

Specified by:
selectMessage in interface AMETASRetrievePolicy
Parameters:
llMess - List of messages from which one message shall be selected.
Returns:
Index of the selected message or NONE_SELECTED if the list is empty.