org.inria.ns.reflex.processor.catalog
Class Resource

java.lang.Object
  extended by org.inria.ns.reflex.processor.catalog.Resource

public class Resource
extends Object

A Resource is a lookup result in a catalog.

If a resource is found, the catalog return an instance of this class with a non-empty list of entries.

If a resource is not found, the catalog may provide additional next catalogs to process.

The iterator that was used to retrieve the resource may be still used to perform further lookup.

Author:
Philippe Poulard
See Also:
Catalog

Constructor Summary
Resource(CatalogKey key)
          Create a sort of "resource not found" resource.
Resource(CatalogKey key, List nextCatalogs, List entries)
          Create a resource found in a catalog ; use getEntries() and getNextCatalogs() after the resource creation.
 
Method Summary
 Iterator getEntries()
          Return the entries found.
 CatalogKey getKey()
          Return the key that was used to retrieve this resource.
 Iterator getNextCatalogs()
          Return the next catalogs to lookup if the key has not been resolved.
 boolean hasEntry()
          Indicates wether an enty has been found or not.
 boolean hasNextCatalogs()
          Indicates wether next catalogs have to be processed or not.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Resource

public Resource(CatalogKey key,
                List nextCatalogs,
                List entries)
Create a resource found in a catalog ; use getEntries() and getNextCatalogs() after the resource creation.

Parameters:
key - The key that was used to retrieve the resource.
nextCatalogs - The next catalogs to lookup if the resource has not been found. Maybe null. Each item of this list must be a CatalogBuilder.
entries - The entries found. Maybe null.
See Also:
CatalogBuilder

Resource

public Resource(CatalogKey key)
Create a sort of "resource not found" resource.

Parameters:
key - The key that was used to retrieve the resource.
Method Detail

getNextCatalogs

public Iterator getNextCatalogs()
Return the next catalogs to lookup if the key has not been resolved. Each item of this list is a CatalogBuilder.

Returns:
The next catalogs to lookup.
See Also:
CatalogBuilder

getEntries

public Iterator getEntries()
Return the entries found. If none found, the lookup may goes on with getNextCatalogs()

Returns:
The entries found (non-null).

getKey

public CatalogKey getKey()
Return the key that was used to retrieve this resource.

Returns:
The key that was used to retrieve this resource.

hasNextCatalogs

public boolean hasNextCatalogs()
Indicates wether next catalogs have to be processed or not.

Returns:
true if at least one next catalog has been found, false otherwise.

hasEntry

public boolean hasEntry()
Indicates wether an enty has been found or not.

Returns:
true if at least one entry has been found, false otherwise.