KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ubermq > kernel > Chooser


1 package com.ubermq.kernel;
2
3 import java.util.*;
4
5 /**
6  * Chooses an object from a supplied set of objects.
7  */

8 public interface Chooser
9     extends java.io.Serializable JavaDoc
10 {
11     /**
12      * Resets any state, if applicable.
13      */

14     public void reset();
15
16     /**
17      * Chooses a single object contained in the
18      * given <code>Collection</code> and returns
19      * it.
20      *
21      * @param objects an unordered Collection of objects
22      * @return an Object r, such that <code>objects.contains(r)</code> is true.
23      * @throws IllegalStateException if the chooser can
24      * only operate on a single Collection object, and
25      * the Collection does not match that of the previous
26      * caller.
27      */

28     public Object JavaDoc choose(Collection objects);
29
30 }
31
Popular Tags