Qwylt

java.lang.module.spi
Class SearchSequence

java.lang.Object
  extended by java.lang.module.SearchPolicy
      extended by java.lang.module.spi.SearchSequence

public class SearchSequence
extends SearchPolicy

A SearchPolicy over a list of repositories.

Since:
Mar 20, 2009
Author:
Bryan Atsatt

Constructor Summary
SearchSequence(ModuleRepository... sequence)
          Constructor.
 
Method Summary
 ModuleArchive find(ModuleQuery query)
          Find the first ModuleArchive that matches the specified query.
 java.util.List<ModuleArchive> findAll(ModuleQuery query)
          Find all ModuleArchive that match the specified query.
protected  ModuleRepository[] getSequence()
           
static SearchPolicy rootFirst()
          Returns a SearchPolicy that searches the root repository and then the local repository.
 java.lang.String toString()
          Returns a string representation of this instance.
 
Methods inherited from class java.lang.module.SearchPolicy
findAllLocal, findLocal, getLocal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SearchSequence

public SearchSequence(ModuleRepository... sequence)
Constructor.

Parameters:
sequence - The sequence of repositories.
Method Detail

rootFirst

public static SearchPolicy rootFirst()
Returns a SearchPolicy that searches the root repository and then the local repository.

Returns:
The SearchPolicy.

find

public ModuleArchive find(ModuleQuery query)
Find the first ModuleArchive that matches the specified query.

Specified by:
find in class SearchPolicy
Parameters:
query - The query.
Returns:
The matching ModuleArchive or null if none.

findAll

public java.util.List<ModuleArchive> findAll(ModuleQuery query)
Find all ModuleArchive that match the specified query.

Specified by:
findAll in class SearchPolicy
Parameters:
query - The query.
Returns:
The list of matching ModuleArchives; empty if no match.

toString

public java.lang.String toString()
Returns a string representation of this instance.

Overrides:
toString in class java.lang.Object
Returns:
The string.

getSequence

protected ModuleRepository[] getSequence()

Qwylt

Send comments or questions to Bryan Atsatt