de.dfki.mycbr.core.retrieval
Class Retrieval

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<Instance,Similarity>
          extended by de.dfki.mycbr.core.retrieval.Retrieval
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, java.util.Map<Instance,Similarity>

public class Retrieval
extends java.util.HashMap<Instance,Similarity>
implements java.lang.Runnable

A retrieval has a retrieval method and a retrieval engine. When specifying a case base and a query you can retrieve a similarity value between the query and each case in the case base.

Author:
myCBR Team
See Also:
Serialized Form

Nested Class Summary
static class Retrieval.RetrievalMethod
           
 
Nested classes/interfaces inherited from class java.util.AbstractMap
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
Retrieval(Concept c, ICaseBase cb)
           
Retrieval(Concept c, ICaseBase cb, RetrievalEngine re)
           
 
Method Summary
 ICaseBase getCaseBase()
           
 int getK()
           
 Instance getQueryInstance()
           
 java.util.List<Pair<Instance,Similarity>> getResult()
           
 RetrievalEngine getRetrievalEngine()
           
 Retrieval.RetrievalMethod getRetrievalMethod()
           
 boolean isFinished()
           
 Instance resetQuery()
          Set all attributes to undefined
 void run()
           
 void setCaseBase(ICaseBase cb)
           
 void setK(int k)
           
 void setRetrievalEngine(RetrievalEngine re)
           
 void setRetrievalMethod(Retrieval.RetrievalMethod m)
           
 void start()
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

Retrieval

public Retrieval(Concept c,
                 ICaseBase cb)
Parameters:
c - the query should be an instance of this concept

Retrieval

public Retrieval(Concept c,
                 ICaseBase cb,
                 RetrievalEngine re)
Parameters:
c - the query should be an instance of this concept
Method Detail

start

public final void start()
Throws:
java.lang.Exception - if something goes wrong during retrieval

setRetrievalEngine

public void setRetrievalEngine(RetrievalEngine re)
Since:
3.0.0 BETA 0.2

getRetrievalEngine

public RetrievalEngine getRetrievalEngine()

setCaseBase

public void setCaseBase(ICaseBase cb)
Since:
3.0.0 BETA 0.3

getCaseBase

public ICaseBase getCaseBase()
Since:
3.0.0 BETA 0.3

getQueryInstance

public Instance getQueryInstance()
Since:
3.0.0 BETA 0.2

resetQuery

public Instance resetQuery()
Set all attributes to undefined

Since:
3.0.0 BETA 0.3

setK

public void setK(int k)
Since:
3.0.0 BETA 0.3

getK

public int getK()
Since:
3.0.0 BETA 0.3

setRetrievalMethod

public final void setRetrievalMethod(Retrieval.RetrievalMethod m)
Parameters:
m - the current retrieval method

isFinished

public boolean isFinished()

getRetrievalMethod

public final Retrieval.RetrievalMethod getRetrievalMethod()
Returns:
the current case

run

public void run()
Specified by:
run in interface java.lang.Runnable

getResult

public java.util.List<Pair<Instance,Similarity>> getResult()