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 ofSearchResult
s- Since:
- 5.0
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
GENERAL_ERROR
Some other errorstatic int
NO_ERROR
No errorstatic int
TOO_MANY_CLAUSES
The search has to many clauses, e.g.static int
TOO_MANY_RESULTS_ERROR
The search has to many results
-
Constructor Summary
Constructors Constructor Description SearchResultCollection()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear()
void
consolidate()
Removes results which DataObjects are not setboolean
contains(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 typeint
getError()
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 typeboolean
isError()
void
setError(int error)
Set the error statejava.lang.String
toString()
-
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:
true
if there was an error with the search,false
otherwise
-
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:
contains
in interfacejava.util.Collection<SearchResult>
- Specified by:
contains
in interfacejava.util.List<SearchResult>
- Overrides:
contains
in classjava.util.ArrayList<SearchResult>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<SearchResult>
- Specified by:
clear
in interfacejava.util.List<SearchResult>
- Overrides:
clear
in 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:
toString
in classjava.util.AbstractCollection<SearchResult>
-
-