org.ungoverned.moduleloader.search.selection
Class InteractiveSelectionPolicy

java.lang.Object
  extended byorg.ungoverned.moduleloader.search.selection.InteractiveSelectionPolicy
All Implemented Interfaces:
SelectionPolicy

public class InteractiveSelectionPolicy
extends java.lang.Object
implements SelectionPolicy

This class implements an interactive selection policy for the ImportSearchPolicy. This policy simply uses standard output to present the list of candidate modules and uses standard input to allow the user to select a specific module from the candidates. This selection policy is generally only useful for debugging purposes.

See Also:
SelectionPolicy, ImportSearchPolicy

Constructor Summary
InteractiveSelectionPolicy()
           
 
Method Summary
 Module select(Module module, java.lang.Object target, java.lang.Object version, Module[] candidates, CompatibilityPolicy compatPolicy)
          Returns a single package from an array of packages.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InteractiveSelectionPolicy

public InteractiveSelectionPolicy()
Method Detail

select

public Module select(Module module,
                     java.lang.Object target,
                     java.lang.Object version,
                     Module[] candidates,
                     CompatibilityPolicy compatPolicy)
Returns a single package from an array of packages.

Specified by:
select in interface SelectionPolicy
Parameters:
module - the module that is importing the target.
target - the identifier of the import target.
version - the version number of the import target.
candidates - array of compatible candidate modules from which to choose.
compatPolicy - the compatibility policy that is being used.
Returns:
the selected package or null if no package can be selected.