Class RetrievalResultListImpl
- java.lang.Object
-
- de.uni_trier.wi2.procake.retrieval.impl.RetrievalResultListImpl
-
- All Implemented Interfaces:
RetrievalResultList,Iterable<RetrievalResult>
- Direct Known Subclasses:
DependencyRetrievalResultListImpl
public class RetrievalResultListImpl extends Object implements RetrievalResultList
This class acts as a wrapper for a set ofRetrievalResults. An object of this class is created in the retrieval process.- Author:
- rmaximi
-
-
Constructor Summary
Constructors Constructor Description RetrievalResultListImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(RetrievalResult rri)Adds a retrieval result to the list.RetrievalResultListImplfromXML(String retrievalResultListXML)Converts a serialized RetrievalResultList-XML into a Query-objectRetrievalResultgetLast()QuerygetQuery()longgetRetrievalTime()longgetRetrievalTime(String format)StringgetRetrievalTimeString()StringgetRetrievalTimeString(String format)Iterator<RetrievalResult>iterator()voidremove(RetrievalResult object)Removes a retrieval result from the list.voidremoveLast()voidsetQuery(Query query)voidsetRetrievalTime(long retrievalTimeNano)Set the retrieval time.intsize()Stream<RetrievalResult>stream()Returns a stream of the retrieval results.ReadableObjectPool<DataObject>toObjectPool()Transforms this retrieval result list into aWriteableObjectPool.StringtoString()StringtoXML()Converts full RetrievalResultList to XMLStringtoXML(HashMap<Class,List<String>> toOmit)Converts RetrievalResultList to XML, ignoring the fields specified in toOmit-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
add
public void add(RetrievalResult rri)
Description copied from interface:RetrievalResultListAdds a retrieval result to the list.- Specified by:
addin interfaceRetrievalResultList- Parameters:
rri- The retrieval result to add.
-
getLast
public RetrievalResult getLast()
-
iterator
public Iterator<RetrievalResult> iterator()
- Specified by:
iteratorin interfaceIterable<RetrievalResult>- Specified by:
iteratorin interfaceRetrievalResultList- Returns:
- an ordered iterator over all retrieval results starting with the most similar one
-
remove
public void remove(RetrievalResult object)
Description copied from interface:RetrievalResultListRemoves a retrieval result from the list.- Specified by:
removein interfaceRetrievalResultList- Parameters:
object- The retrieval result to remove.
-
removeLast
public void removeLast()
-
size
public int size()
- Specified by:
sizein interfaceRetrievalResultList- Returns:
- The number of retrieval results.
-
toObjectPool
public ReadableObjectPool<DataObject> toObjectPool()
Description copied from interface:RetrievalResultListTransforms this retrieval result list into aWriteableObjectPool.- Specified by:
toObjectPoolin interfaceRetrievalResultList- Returns:
- the transformed pool
-
getRetrievalTime
public long getRetrievalTime()
- Specified by:
getRetrievalTimein interfaceRetrievalResultList- Returns:
- The time used for retrieval in nanoseconds.
-
setRetrievalTime
public void setRetrievalTime(long retrievalTimeNano)
Description copied from interface:RetrievalResultListSet the retrieval time.- Specified by:
setRetrievalTimein interfaceRetrievalResultList- Parameters:
retrievalTimeNano- the retrieval time in nanoseconds
-
getRetrievalTime
public long getRetrievalTime(String format)
- Specified by:
getRetrievalTimein interfaceRetrievalResultList- Parameters:
format- The format for the time (nanoseconds, microseconds, milliseconds, seconds)- Returns:
- The time used for retrieval in the specified format.
-
getRetrievalTimeString
public String getRetrievalTimeString()
- Specified by:
getRetrievalTimeStringin interfaceRetrievalResultList- Returns:
- The time used for retrieval as formatted String
-
getRetrievalTimeString
public String getRetrievalTimeString(String format)
- Specified by:
getRetrievalTimeStringin interfaceRetrievalResultList- Parameters:
format- The format for the time (nanoseconds, microseconds, milliseconds, seconds)- Returns:
- The time used for retrieval as String in the specified format.
-
getQuery
public Query getQuery()
-
setQuery
public void setQuery(Query query)
-
stream
public Stream<RetrievalResult> stream()
Description copied from interface:RetrievalResultListReturns a stream of the retrieval results.- Specified by:
streamin interfaceRetrievalResultList- Returns:
- a stream of results
-
toXML
public String toXML()
Description copied from interface:RetrievalResultListConverts full RetrievalResultList to XML- Specified by:
toXMLin interfaceRetrievalResultList- Returns:
- XML String
-
toXML
public String toXML(HashMap<Class,List<String>> toOmit)
Description copied from interface:RetrievalResultListConverts RetrievalResultList to XML, ignoring the fields specified in toOmit- Specified by:
toXMLin interfaceRetrievalResultList- Parameters:
toOmit- HashMap that contains classes as a key and a corresponding list of fields that should be ignored in the particular class- Returns:
- XML String
-
fromXML
public RetrievalResultListImpl fromXML(String retrievalResultListXML)
Description copied from interface:RetrievalResultListConverts a serialized RetrievalResultList-XML into a Query-object- Specified by:
fromXMLin interfaceRetrievalResultList- Parameters:
retrievalResultListXML- Query XML String- Returns:
- Query-object
-
-