Package omero.gateway.model
Class SearchResultCollection
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<SearchResult>
-
- omero.gateway.model.SearchResultCollection
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<SearchResult>,java.util.Collection<SearchResult>,java.util.List<SearchResult>,java.util.RandomAccess
public class SearchResultCollection extends java.util.ArrayList<SearchResult>
Holds the results of a search; a collection ofSearchResults- Since:
- 5.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intGENERAL_ERRORSome other errorstatic intNO_ERRORNo errorstatic intTOO_MANY_CLAUSESThe search has to many clauses, e.g.static intTOO_MANY_RESULTS_ERRORThe search has to many results
-
Constructor Summary
Constructors Constructor Description SearchResultCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()voidconsolidate()Removes results which DataObjects are not setbooleancontains(java.lang.Object o)java.util.Map<java.lang.Long,java.util.List<SearchResult>>getByGroup()Get a perGroup map representation of the resultsjava.util.Map<java.lang.Long,java.util.List<SearchResult>>getByGroup(java.lang.Class<? extends DataObject> type)Get a perGroup map representation of the results, filtered by typejava.util.List<DataObject>getDataObjects(int scopeId, java.lang.Class<? extends DataObject> type)Get DataObjects filtered by scope and typeintgetError()Get the error codejava.util.List<SearchResult>getResults(int scopeId, java.lang.Class<? extends DataObject> type)Get all results of a certain scope and/or typebooleanisError()voidsetError(int error)Set the error statejava.lang.StringtoString()-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clone, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Field Detail
-
NO_ERROR
public static final int NO_ERROR
No error- See Also:
- Constant Field Values
-
GENERAL_ERROR
public static final int GENERAL_ERROR
Some other error- See Also:
- Constant Field Values
-
TOO_MANY_RESULTS_ERROR
public static final int TOO_MANY_RESULTS_ERROR
The search has to many results- See Also:
- Constant Field Values
-
TOO_MANY_CLAUSES
public static final int TOO_MANY_CLAUSES
The search has to many clauses, e.g. a 'a*' search term would expand to too many single clauses- See Also:
- Constant Field Values
-
-
Method Detail
-
isError
public boolean isError()
- Returns:
trueif there was an error with the search,falseotherwise
-
setError
public void setError(int error)
Set the error state- Parameters:
error- The value to set.
-
getError
public int getError()
Get the error code- Returns:
- See above.
-
contains
public boolean contains(java.lang.Object o)
- Specified by:
containsin interfacejava.util.Collection<SearchResult>- Specified by:
containsin interfacejava.util.List<SearchResult>- Overrides:
containsin classjava.util.ArrayList<SearchResult>
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection<SearchResult>- Specified by:
clearin interfacejava.util.List<SearchResult>- Overrides:
clearin classjava.util.ArrayList<SearchResult>
-
getResults
public java.util.List<SearchResult> getResults(int scopeId, java.lang.Class<? extends DataObject> type)
Get all results of a certain scope and/or type- Parameters:
scopeId- The scope to filter for.type- The type to filter for, seeDataObject- Returns:
- See above.
-
getDataObjects
public java.util.List<DataObject> getDataObjects(int scopeId, java.lang.Class<? extends DataObject> type)
Get DataObjects filtered by scope and type- Parameters:
scopeId-type-- Returns:
- See above.
-
getByGroup
public java.util.Map<java.lang.Long,java.util.List<SearchResult>> getByGroup()
Get a perGroup map representation of the results- Returns:
- See above.
-
getByGroup
public java.util.Map<java.lang.Long,java.util.List<SearchResult>> getByGroup(java.lang.Class<? extends DataObject> type)
Get a perGroup map representation of the results, filtered by type- Parameters:
type-- Returns:
- See above.
-
consolidate
public void consolidate()
Removes results which DataObjects are not set
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.AbstractCollection<SearchResult>
-
-