public class DefaultSearchResultND extends AbstractSearchResult
Modifier and Type | Class and Description |
---|---|
protected class |
DefaultSearchResultND.EntryList |
protected class |
DefaultSearchResultND.ResultNDCache |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_START_SIZE |
protected java.util.Map<de.ims.icarus.search_tools.result.DefaultSearchResultND.Key,java.util.List<ResultEntry>> |
entries |
protected int[][] |
groupMatchCounts |
protected int |
hitCount |
protected int[] |
indexBuffer |
protected int[] |
indexPermutator
Keeps track of the total permutation to be applied
on entries stored in
DefaultSearchResultND.ResultNDCache objects created
from this result. |
protected java.util.List<ResultEntry> |
totalEntries |
annotationBuffer, finalized, groupConstraints, groupIndexMap, groupInstances, groupTokens, lock, properties, search
DUMMY_INSTANCE, FORCE_SIMPLE_OUTLINE_PROPERTY
Constructor and Description |
---|
DefaultSearchResultND(Search search,
SearchConstraint[] groupConstraints) |
DefaultSearchResultND(Search search,
SearchConstraint[] groupConstraints,
int size) |
Modifier and Type | Method and Description |
---|---|
void |
addEntry(ResultEntry entry,
int... groupIndices) |
boolean |
canReorder() |
void |
clear()
Deletes the content of this result.
|
protected void |
commit(ResultEntry entry,
DefaultSearchResultND.ResultNDCache cache) |
GroupCache |
createCache() |
java.lang.Object |
getEntry(int index)
Returns the entry object at the specified index.
|
java.lang.Object |
getEntryAt(int index,
int... groupIndices)
Shorthand method for accessing an entry within the list-view
that is represented by
SearchResult.getEntryList(int...) |
de.ims.icarus.util.data.DataList<? extends java.lang.Object> |
getEntryList(int... groupIndices)
Returns a list-oriented view of all the entries for the
specified combination of group-instances.
|
int |
getGroupMatchCount(int groupId,
int index)
Returns the number of matches with an instance of the given
group in them.
|
protected java.util.List<ResultEntry> |
getList(int[] indices,
boolean createIfMissing) |
int |
getMatchCount(int... groupIndices)
Returns the number of matches reported for the given combination
of instances.
|
ResultEntry |
getRawEntry(int index) |
ResultEntry |
getRawEntryAt(int index,
int... groupIndices) |
java.util.List<ResultEntry> |
getRawEntryList(int... groupIndices) |
SearchResult |
getSubResult(int... groupInstances)
Creates and returns a new
SearchResult that is backed by this
result object and presents a view of a lesser dimension with some
group variables set to the specified instances. |
int |
getTotalHitCount()
Returns the total count of reported hits in this result.
|
int |
getTotalMatchCount()
Returns the total count of reported matches in this result
|
boolean |
reorder(int[] permutation)
Applies the given
permutation array to the internal order
of groups and reorders all affected entries in this result. |
void |
writeEntries(SearchWriter writer) |
finish, getAnnotatedEntry, getAnnotationBuffer, getAnnotationType, getContentType, getContext, getDimension, getGroupConstraint, getGroupLabel, getIndexOf, getInstanceCount, getInstanceLabel, getPlainEntry, getProperty, getSource, getTarget, isFinal, setAnnotationBuffer, setGroupInstances, setProperty
protected java.util.Map<de.ims.icarus.search_tools.result.DefaultSearchResultND.Key,java.util.List<ResultEntry>> entries
protected java.util.List<ResultEntry> totalEntries
protected int hitCount
protected final int[] indexBuffer
protected int[][] groupMatchCounts
public static final int DEFAULT_START_SIZE
protected final int[] indexPermutator
DefaultSearchResultND.ResultNDCache
objects created
from this result.public DefaultSearchResultND(Search search, SearchConstraint[] groupConstraints)
public DefaultSearchResultND(Search search, SearchConstraint[] groupConstraints, int size)
protected java.util.List<ResultEntry> getList(int[] indices, boolean createIfMissing)
public SearchResult getSubResult(int... groupInstances)
SearchResult
SearchResult
that is backed by this
result object and presents a view of a lesser dimension with some
group variables set to the specified instances.getSubResult
in interface SearchResult
getSubResult
in class AbstractSearchResult
SearchResult.getSubResult(int[])
public int getTotalMatchCount()
SearchResult
SearchResult.getTotalMatchCount()
public int getMatchCount(int... groupIndices)
SearchResult
SearchResult.getMatchCount(int[])
public java.lang.Object getEntry(int index)
SearchResult
SearchResult.getEntry(int)
public ResultEntry getRawEntry(int index)
SearchResult.getRawEntry(int)
public de.ims.icarus.util.data.DataList<? extends java.lang.Object> getEntryList(int... groupIndices)
SearchResult
SearchResult.getEntryList(int[])
public java.util.List<ResultEntry> getRawEntryList(int... groupIndices)
SearchResult.getRawEntryList(int[])
public java.lang.Object getEntryAt(int index, int... groupIndices)
SearchResult
SearchResult.getEntryList(int...)
SearchResult.getEntryAt(int, int[])
public ResultEntry getRawEntryAt(int index, int... groupIndices)
public GroupCache createCache()
de.ims.icarus.search_tools.corpus.AbstractCorpusSearchResult#createCache()
protected void commit(ResultEntry entry, DefaultSearchResultND.ResultNDCache cache)
public void clear()
SearchResult
An implementation should throw an IllegalStateException
in case
the result is still under construction and not final.
SearchResult.clear()
public int getTotalHitCount()
SearchResult
Note that an arbitrary number of hits can be wrapped into a single match!
public int getGroupMatchCount(int groupId, int index)
SearchResult
public boolean canReorder()
canReorder
in interface SearchResult
canReorder
in class AbstractSearchResult
public boolean reorder(int[] permutation)
SearchResult
permutation
array to the internal order
of groups and reorders all affected entries in this result.
Returns true
in case the reordering was successful
reorder
in interface SearchResult
reorder
in class AbstractSearchResult
public void writeEntries(SearchWriter writer) throws javax.xml.stream.XMLStreamException
writeEntries
in class AbstractSearchResult
javax.xml.stream.XMLStreamException
AbstractSearchResult.writeEntries(de.ims.icarus.search_tools.io.SearchWriter)
public void addEntry(ResultEntry entry, int... groupIndices)
addEntry
in class AbstractSearchResult