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>>
ResultStructuresare the leaves in the tree of nestedSearchStructures. EachResultStructuredefines a result of a search and thus holds a set of values. It also implements theMergeAndCopyStructureinterface to be able to combine the values of two result structures.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ResultStructure<R>copy()This method copies the object which calls it.static <R> ResultStructure<R>createWith(java.util.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.booleanequals(java.lang.Object obj)java.util.Set<R>get()Returns the set of resulting values.SearchStructure<R>get(java.lang.Object key)Returns the nestedSearchStructurefor the given key.inthashCode()voidmerge(ResultStructure<R> otherStructure)Merging adds the contents of the otherMergable to this object.java.lang.StringtoString()-
Methods inherited from class org.faktorips.runtime.internal.tableindex.SearchStructure
getUnique, getUnique
-
-
-
-
Method Detail
-
createWith
public static <R> ResultStructure<R> createWith(R resultValue)
Creates a newResultSetwith the given resultValue as its only result value.
-
createWith
public static <R> ResultStructure<R> createWith(java.util.Set<R> resultValues)
Creates a newResultSetwith the given set of result values.
-
get
public SearchStructure<R> get(java.lang.Object key)
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
public java.util.Set<R> 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
public void merge(ResultStructure<R> otherStructure)
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()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
copy
public ResultStructure<R> 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
-
-