public interface SearchResult
extends de.ims.icarus.util.annotation.AnnotationContainer
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DUMMY_INSTANCE |
static java.lang.String |
FORCE_SIMPLE_OUTLINE_PROPERTY
Marks a result that should be visualized without any
special presenter and be displayed only as a plain
list of matches.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canReorder() |
void |
clear()
Deletes the content of this result.
|
GroupCache |
createCache() |
void |
finish()
Attempts to finalize this result so that future modifications
will be discarded.
|
de.ims.icarus.util.annotation.AnnotatedData |
getAnnotatedEntry(ResultEntry entry) |
de.ims.icarus.util.data.ContentType |
getContentType()
Returns the
ContentType representing the entries in this
result. |
int |
getDimension()
Returns the total number of groupings in the result
|
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
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.
|
SearchConstraint |
getGroupConstraint(int index)
Returns the
SearchConstraint that declared the grouping
for the given index |
java.lang.Object |
getGroupLabel(int groupId)
Returns the label to be used as title for the grouping at index
groupId . |
int |
getGroupMatchCount(int groupId,
int index)
Returns the number of matches with an instance of the given
group in them.
|
int |
getIndexOf(int groupId,
java.lang.Object label)
Returns the index of the given
label object within the list
that holds all the encountered labels for the specified group. |
int |
getInstanceCount(int groupId)
Returns the number of instances that were reported for the
given
groupId . |
java.lang.Object |
getInstanceLabel(int groupId,
int index)
Returns the label to be used for the instance at
index in
group groupId . |
int |
getMatchCount(int... groupIndices)
Returns the number of matches reported for the given combination
of instances.
|
java.lang.Object |
getPlainEntry(ResultEntry entry) |
java.lang.Object |
getProperty(java.lang.String key) |
ResultEntry |
getRawEntry(int index) |
ResultEntry |
getRawEntryAt(int index,
int... groupIndices) |
java.util.List<ResultEntry> |
getRawEntryList(int... groupIndices) |
Search |
getSource()
Returns the
Search that wraps all the information
about the origin of this result. |
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 |
isFinal()
Returns
true if and only if the search constructing this
result is completed and no more modifications are to be expected. |
boolean |
reorder(int[] permutation)
Applies the given
permutation array to the internal order
of groups and reorders all affected entries in this result. |
void |
setProperty(java.lang.String key,
java.lang.Object value) |
static final java.lang.String DUMMY_INSTANCE
static final java.lang.String FORCE_SIMPLE_OUTLINE_PROPERTY
void setProperty(java.lang.String key, java.lang.Object value)
java.lang.Object getProperty(java.lang.String key)
int getDimension()
Search getSource()
Search
that wraps all the information
about the origin of this result.int getTotalMatchCount()
int getTotalHitCount()
Note that an arbitrary number of hits can be wrapped into a single match!
int getMatchCount(int... groupIndices)
int getGroupMatchCount(int groupId, int index)
int getInstanceCount(int groupId)
groupId
.SearchConstraint getGroupConstraint(int index)
SearchConstraint
that declared the grouping
for the given indexde.ims.icarus.util.data.ContentType getContentType()
ContentType
representing the entries in this
result. For treebanks this would be directly forwarded to the
treebank the search was targeted at.java.lang.Object getGroupLabel(int groupId)
groupId
. Typically this will be the localized string as
returned by ConstraintFactory.getName()
by the factory
that created the SearchConstraint
at the specified index.java.lang.Object getInstanceLabel(int groupId, int index)
index
in
group groupId
. Typically this will be the actual value as
encountered by the search without any localization or other modification
outside the value-to-label-conversion performed by
ConstraintFactory#valueToLabel(Object)
.int getIndexOf(int groupId, java.lang.Object label)
label
object within the list
that holds all the encountered labels for the specified group.java.lang.Object getEntry(int index)
java.lang.IndexOutOfBoundsException
- if index
< 0 or
index
≥ getTotalMatchCount()
java.lang.Object getPlainEntry(ResultEntry entry)
ResultEntry getRawEntry(int index)
de.ims.icarus.util.annotation.AnnotatedData getAnnotatedEntry(ResultEntry entry)
boolean reorder(int[] permutation)
permutation
array to the internal order
of groups and reorders all affected entries in this result.
Returns true
in case the reordering was successful
boolean canReorder()
de.ims.icarus.util.data.DataList<? extends java.lang.Object> getEntryList(int... groupIndices)
java.util.List<ResultEntry> getRawEntryList(int... groupIndices)
java.lang.Object getEntryAt(int index, int... groupIndices)
getEntryList(int...)
java.lang.IndexOutOfBoundsException
- if one of the indices is outside
the boundaries for its specific list.java.lang.IllegalStateException
- if the result is not final and the
implementation does not support entry retrieval during a running searchResultEntry getRawEntryAt(int index, int... groupIndices)
SearchResult getSubResult(int... groupInstances)
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.java.lang.IndexOutOfBoundsException
- if one of the indices is outside
the boundaries for its specific list.java.lang.IllegalStateException
- if the result is not final and the
implementation does not support creation of sub-results during a
running searchboolean isFinal()
true
if and only if the search constructing this
result is completed and no more modifications are to be expected.
Since construction of specialized views on a complex search-result can
be quite expensive, visualization facilities are adviced to check this
method before attempting to present such views while the search is still
in progress or before allowing the user to do so.
Note that implementations are allowed to throw IllegalStateException
when they do not support certain operations during a running search.
GroupCache createCache()
void clear()
An implementation should throw an IllegalStateException
in case
the result is still under construction and not final.
java.lang.IllegalStateException
void finish()
An implementation should throw an IllegalStateException
in case
the result is already final.
java.lang.IllegalStateException