Class IdentifiedObjectFinder.Wrapper
Object
IdentifiedObjectFinder
Wrapper
- Enclosing class:
IdentifiedObjectFinder
An object finder which delegates some or all work to another object finder.
The default implementation of all
Wrapper
methods delegates the work to the object finder
specified at construction time or in the last call to delegate(IdentifiedObjectFinder)
.
Subclasses can override methods for modifying some find operations.- Since:
- 1.5
-
Nested Class Summary
Nested classes/interfaces inherited from class IdentifiedObjectFinder
IdentifiedObjectFinder.Domain, IdentifiedObjectFinder.Wrapper
-
Field Summary
Fields inherited from class IdentifiedObjectFinder
factory
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Wrapper
(IdentifiedObjectFinder finder) Creates a new object finder which will delegate the actual work to the given finder. -
Method Summary
Modifier and TypeMethodDescriptionprotected IdentifiedObjectFinder
delegate()
Returns the object finder to which to delegate the actual search operations.protected void
delegate
(IdentifiedObjectFinder finder) Sets a new finder to which to delegate the actual search operations.find
(IdentifiedObject object) Looks up objects which are approximately equal to the specified object.findSingleton
(IdentifiedObject object) Looks up only one object which is approximately equal to the specified object.getCodeCandidates
(IdentifiedObject object) Returns a set of authority codes that may identify the same object as the specified one.Methods inherited from class IdentifiedObjectFinder
getSearchDomain, isIgnoringAxes, setIgnoringAxes, setSearchDomain
-
Constructor Details
-
Wrapper
Creates a new object finder which will delegate the actual work to the given finder.- Parameters:
finder
- the object finder to which to delegate the work.
-
-
Method Details
-
delegate
Sets a new finder to which to delegate the actual search operations. If the specified finder isthis
, then this class will delegate to the default method implementations provided by theIdentifiedObjectFinder
parent class. Otherwise, the specified finder should be a new instance not in use by other code.- Parameters:
finder
- the object finder to which to delegate the work. Can bethis
.- Throws:
FactoryException
- if the delegate cannot be set.
-
delegate
Returns the object finder to which to delegate the actual search operations. If this method returnsthis
, then the search operations will be delegated to the default methods provided by theIdentifiedObjectFinder
parent class.- Returns:
- the object finder to which to delegate the work. May be
this
. - Throws:
FactoryException
- if the delegate cannot be created.
-
find
Looks up objects which are approximately equal to the specified object. The default method implementation delegates the work to the finder specified bydelegate()
.- Overrides:
find
in classIdentifiedObjectFinder
- Parameters:
object
- the object looked up.- Returns:
- the identified objects, or an empty set if not found.
- Throws:
FactoryException
- if an error occurred while fetching the authority code candidates.
-
findSingleton
Looks up only one object which is approximately equal to the specified object. The default method implementation delegates the work to the finder specified bydelegate()
.- Overrides:
findSingleton
in classIdentifiedObjectFinder
- Parameters:
object
- the object looked up.- Returns:
- the identified object, or
null
if none or ambiguous. - Throws:
FactoryException
- if an error occurred while fetching the authority code candidates.
-
getCodeCandidates
Returns a set of authority codes that may identify the same object as the specified one. The default method implementation delegates the work to the finder specified bydelegate()
.- Overrides:
getCodeCandidates
in classIdentifiedObjectFinder
- Parameters:
object
- the object looked up.- Returns:
- a set of code candidates.
- Throws:
FactoryException
- if an error occurred while fetching the set of code candidates.- See Also:
-