Interface References<R>
- Type Parameters:
R- the contextual reference type
- All Superinterfaces:
Iterable<R>,ReferencesSelector
An
Iterable providing access to contextual references of a given type, and a ReferencesSelector providing access to a References of a different type.- Author:
- Laird Nelson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDestroys the supplied contextual reference if and only if it meets the conditions for destruction.default Rget()A convenience method that acquires and returns what is presumed, possibly incorrectly, to be the sole contextual reference available from thisReferences.intsize()Returns the size of thisReferences.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.microbean.bean.ReferencesSelector
reference, references
-
Method Details
-
get
A convenience method that acquires and returns what is presumed, possibly incorrectly, to be the sole contextual reference available from thisReferences.- Returns:
- a contextual reference; never
null - Throws:
UnsatisfiedReductionException- if there are no contextual references to returnAmbiguousReductionException- if there is more than one contextual reference to return
-
destroy
Destroys the supplied contextual reference if and only if it meets the conditions for destruction.- Parameters:
r- a contextual reference; may benullin which casefalsewill be returned- Returns:
trueif and only if destruction occurred- Throws:
DestructionException- if an error occurs
-
size
int size()Returns the size of thisReferences.- Returns:
- the size of this
References(a positive integer)
-