Class ResultStructure<R>
java.lang.Object
org.faktorips.runtime.internal.tableindex.SearchStructure<R>
org.faktorips.runtime.internal.tableindex.ResultStructure<R>
- All Implemented Interfaces:
MergeAndCopyStructure<ResultStructure<R>>
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.-
Method Summary
Modifier and TypeMethodDescriptioncopy()This method copies the object which calls it.static <R> ResultStructure<R>createWith(Set<R> resultValues) Creates a newResultSetwith the given set of result values.static <R> ResultStructure<R>createWith(R resultValue) Creates a newResultSetwith the given resultValue as its only result value.booleanget()Returns the set of resulting values.Returns the nestedSearchStructurefor the given key.inthashCode()voidmerge(ResultStructure<R> otherStructure) Merging adds the contents of the otherMergable to this object.toString()Methods inherited from class org.faktorips.runtime.internal.tableindex.SearchStructure
getUnique, getUnique
-
Method Details
-
createWith
Creates a newResultSetwith the given resultValue as its only result value. -
createWith
Creates a newResultSetwith the given set of result values. -
get
Description copied from class:SearchStructureReturns the nestedSearchStructurefor the given key. This method never returnsnull. If no value exists for a given key anEmptySearchStructureis returned as a fall-back.- Specified by:
getin classSearchStructure<R>- Parameters:
key- The key for the requested nestedSearchStructure- Returns:
- The nested
SearchStructureor anEmptySearchStructureif the key does not exist.
-
get
Description copied from class:SearchStructureReturns the set of resulting values. If thisSearchStructureis noResultStructurethis method simply aggregates every nestedstructures'results. Beware that the aggregation of nested elements has linear complexity.- Specified by:
getin classSearchStructure<R>- Returns:
- The set of resulting values that are reachable by this
SearchStructure
-
merge
Description copied from interface:MergeAndCopyStructureMerging adds the contents of the otherMergable to this object. This object then contains the combined content. The other object remains unchanged.Merging aSearchStructuredeletes no content, instead equal values are being merged recursively.- Specified by:
mergein interfaceMergeAndCopyStructure<R>- Parameters:
otherStructure- The object that should be merged into this object
-
hashCode
public int hashCode() -
equals
-
toString
-
copy
Description copied from interface:MergeAndCopyStructureThis method copies the object which calls it. The newly created object has the same properties like the object callingMergeAndCopyStructure.copy().- Specified by:
copyin interfaceMergeAndCopyStructure<R>- Returns:
- T that is a copy of the calling object
-