public class ResultStructure<R> extends SearchStructure<R> implements MergeAndCopyStructure<ResultStructure<R>>
ResultStructures are the leaves in the tree of nested
SearchStructures. Each ResultStructure defines a result of a
search and thus holds a set of values. It also implements the MergeAndCopyStructure
interface to be able to combine the values of two result structures.| Modifier and Type | Method and Description |
|---|---|
ResultStructure<R> |
copy()
This method copies the object which calls it.
|
static <R> ResultStructure<R> |
createWith(R resultValue)
Creates a new
ResultSet with the given resultValue as its only result value. |
static <R> ResultStructure<R> |
createWith(Set<R> resultValues)
Creates a new
ResultSet with the given set of result values. |
boolean |
equals(Object obj) |
Set<R> |
get()
Returns the set of resulting values.
|
SearchStructure<R> |
get(Object key)
Returns the nested
SearchStructure for the given key. |
int |
hashCode() |
void |
merge(ResultStructure<R> otherStructure)
Merging adds the contents of the otherMergable to this object.
|
String |
toString() |
getUnique, getUniquepublic static <R> ResultStructure<R> createWith(R resultValue)
ResultSet with the given resultValue as its only result value.public static <R> ResultStructure<R> createWith(Set<R> resultValues)
ResultSet with the given set of result values.public SearchStructure<R> get(Object key)
SearchStructureSearchStructure for the given key. This method never returns
null. If no value exists for a given key an EmptySearchStructure is
returned as a fall-back.get in class SearchStructure<R>key - The key for the requested nested SearchStructureSearchStructure or an EmptySearchStructure if the key does
not exist.public Set<R> get()
SearchStructureSearchStructure is no
ResultStructure this method simply aggregates every nested structures' results. Beware that the aggregation of nested elements has linear complexity.get in class SearchStructure<R>SearchStructurepublic void merge(ResultStructure<R> otherStructure)
MergeAndCopyStructureSearchStructure
deletes no content, instead equal values are being merged recursively.merge in interface MergeAndCopyStructure<ResultStructure<R>>otherStructure - The object that should be merged into this objectpublic ResultStructure<R> copy()
MergeAndCopyStructureMergeAndCopyStructure.copy().copy in interface MergeAndCopyStructure<ResultStructure<R>>Copyright © 2016. All rights reserved.