net.sf.freecol.common.option
Interface ListOptionSelector<T>

Type Parameters:
T - The type of the objects that can be added to a ListOption.

public interface ListOptionSelector<T>

Instances of this class is responsible for offering a list of objects that can be added to a ListOption. It's also responsible for generating IDs and creating string representations of the objects.


Method Summary
 java.lang.String getId(T t)
          Gets the id that should be used to identify an object in a ListOption.
 T getObject(java.lang.String id)
          Gets an object using the specific id.
 java.util.List<T> getOptions()
          Gets all available options.
 java.lang.String toString(T t)
          Returns a human readable presentation of the given object.
 

Method Detail

getOptions

java.util.List<T> getOptions()
Gets all available options.

Returns:
A list of all the options that can be added to a specific ListOption.

getObject

T getObject(java.lang.String id)
Gets an object using the specific id.

Parameters:
id - The string identifying the object.
Returns:
The object.

getId

java.lang.String getId(T t)
Gets the id that should be used to identify an object in a ListOption.

Parameters:
t - The id.
Returns:
String

toString

java.lang.String toString(T t)
Returns a human readable presentation of the given object.

Parameters:
t - The object to create a string representation for.
Returns:
A string representation that can be used in a user interface.