Class RetrievalResultListImpl
java.lang.Object
de.uni_trier.wi2.procake.retrieval.impl.RetrievalResultListImpl
- All Implemented Interfaces:
RetrievalResultList
,Iterable<RetrievalResult>
- Direct Known Subclasses:
DependencyRetrievalResultListImpl
This class acts as a wrapper for a set of
RetrievalResult
s. An object of this class is
created in the retrieval process.- Author:
- rmaximi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(RetrievalResult rri) Adds a retrieval result to the list.Converts a serialized RetrievalResultList-XML into a Query-objectgetLast()
getQuery()
long
long
getRetrievalTime
(String format) getRetrievalTimeString
(String format) iterator()
void
remove
(RetrievalResult object) Removes a retrieval result from the list.void
Removes a retrieval result from the list.void
void
void
setRetrievalTime
(long retrievalTimeNano) Set the retrieval time.int
size()
stream()
Returns a stream of the retrieval results.Transforms this retrieval result list into aWriteableObjectPool
.toString()
toXML()
Converts full RetrievalResultList to XMLConverts RetrievalResultList to XML, ignoring the fields specified in toOmitMethods 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
-
Constructor Details
-
RetrievalResultListImpl
public RetrievalResultListImpl()
-
-
Method Details
-
add
Description copied from interface:RetrievalResultList
Adds a retrieval result to the list.- Specified by:
add
in interfaceRetrievalResultList
- Parameters:
rri
- The retrieval result to add.
-
getLast
-
iterator
- Specified by:
iterator
in interfaceIterable<RetrievalResult>
- Specified by:
iterator
in interfaceRetrievalResultList
- Returns:
- an ordered iterator over all retrieval results starting with the most similar one
-
remove
Description copied from interface:RetrievalResultList
Removes a retrieval result from the list.- Specified by:
remove
in interfaceRetrievalResultList
- Parameters:
object
- The retrieval result to remove.
-
remove
Description copied from interface:RetrievalResultList
Removes a retrieval result from the list.- Specified by:
remove
in interfaceRetrievalResultList
- Parameters:
resultObjectId
- The retrieval result to remove.
-
removeLast
public void removeLast() -
size
public int size()- Specified by:
size
in interfaceRetrievalResultList
- Returns:
- The number of retrieval results.
-
toString
-
toObjectPool
Description copied from interface:RetrievalResultList
Transforms this retrieval result list into aWriteableObjectPool
.- Specified by:
toObjectPool
in interfaceRetrievalResultList
- Returns:
- the transformed pool
-
getRetrievalTime
public long getRetrievalTime()- Specified by:
getRetrievalTime
in interfaceRetrievalResultList
- Returns:
- The time used for retrieval in nanoseconds.
-
setRetrievalTime
public void setRetrievalTime(long retrievalTimeNano) Description copied from interface:RetrievalResultList
Set the retrieval time.- Specified by:
setRetrievalTime
in interfaceRetrievalResultList
- Parameters:
retrievalTimeNano
- the retrieval time in nanoseconds
-
getRetrievalTime
- Specified by:
getRetrievalTime
in interfaceRetrievalResultList
- Parameters:
format
- The format for the time (nanoseconds, microseconds, milliseconds, seconds)- Returns:
- The time used for retrieval in the specified format.
-
getRetrievalTimeString
- Specified by:
getRetrievalTimeString
in interfaceRetrievalResultList
- Returns:
- The time used for retrieval as formatted String
-
getRetrievalTimeString
- Specified by:
getRetrievalTimeString
in 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
- Specified by:
getQuery
in interfaceRetrievalResultList
- Returns:
- query
-
setQuery
-
stream
Description copied from interface:RetrievalResultList
Returns a stream of the retrieval results.- Specified by:
stream
in interfaceRetrievalResultList
- Returns:
- a stream of results
-
toXML
Description copied from interface:RetrievalResultList
Converts full RetrievalResultList to XML- Specified by:
toXML
in interfaceRetrievalResultList
- Returns:
- XML String
-
toXML
Description copied from interface:RetrievalResultList
Converts RetrievalResultList to XML, ignoring the fields specified in toOmit- Specified by:
toXML
in 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
Description copied from interface:RetrievalResultList
Converts a serialized RetrievalResultList-XML into a Query-object- Specified by:
fromXML
in interfaceRetrievalResultList
- Parameters:
retrievalResultListXML
- Query XML String- Returns:
- Query-object
-