Class Encoder
java.lang.Object
com.semedy.reasoner.reasoning.processes.Encoder
- All Implemented Interfaces:
Receiver
Takes a package of input tuples and internalizes terms in it.
Used as post processor for built-ins.
Used as post processor for built-ins.
- Author:
- angele
-
Constructor Summary
ConstructorsConstructorDescriptionEncoder
(SymbolTable symbols, int[] index, int arity, ReasoningMonitor monitor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRelation
(ReasoningRelation relation) add a whole relation at the beginningint
getArity()
arity of the tuplesget the basic tuple storeboolean
receiveRelation
(ReasoningRelation relation) receive a whole relationboolean
receiveTuple
(int tuple) receive a single tupleboolean
receiveTuple
(long[] tuple) receive a single tupleboolean
receiveTuple
(TupleBuffer tuple) receive a single tuplevoid
setNextReceiver
(Receiver next) startTuples
(Receiver source, boolean check4Duplicates) start delivering single tuplesvoid
tuplesFinished
(boolean isBottomUp) finish delivering single tuplesvoid
tuplesFinished
(String annotation, ReasoningRelation T1, ReasoningRelation T2) Finish delivering single tuples.
-
Constructor Details
-
Encoder
-
-
Method Details
-
setNextReceiver
-
receiveTuple
public boolean receiveTuple(long[] tuple) throws SemReasonerException, IOException, InterruptedException Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
SemReasonerException
IOException
InterruptedException
-
receiveTuple
public boolean receiveTuple(int tuple) throws SemReasonerException, IOException, InterruptedException Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
SemReasonerException
IOException
InterruptedException
-
receiveTuple
public boolean receiveTuple(TupleBuffer tuple) throws SemReasonerException, IOException, InterruptedException Description copied from interface:Receiver
receive a single tuple- Specified by:
receiveTuple
in interfaceReceiver
- Parameters:
tuple
- the tuple to be received- Returns:
- true if tuple has been used (tuple cannot be free'd up)
- Throws:
ReasoningException
SemReasonerException
IOException
InterruptedException
-
tuplesFinished
public void tuplesFinished(boolean isBottomUp) throws IOException, SemReasonerException, InterruptedException Description copied from interface:Receiver
finish delivering single tuples- Specified by:
tuplesFinished
in interfaceReceiver
- Parameters:
isBottomUp
- TODO- Throws:
IOException
ReasoningException
SemReasonerException
InterruptedException
-
startTuples
public Receiver startTuples(Receiver source, boolean check4Duplicates) throws EDBException, IOException Description copied from interface:Receiver
start delivering single tuples- Specified by:
startTuples
in interfaceReceiver
- Parameters:
source
- , the delivering processcheck4Duplicates
- , check for duplicates in the target store- Returns:
- an object receiving the results
- Throws:
EDBException
IOException
-
tuplesFinished
public void tuplesFinished(String annotation, ReasoningRelation T1, ReasoningRelation T2) throws SemReasonerException, InterruptedException, IOException Description copied from interface:Receiver
Finish delivering single tuples.
Cache result and annotate result.- Specified by:
tuplesFinished
in interfaceReceiver
- Parameters:
annotation
- , an annotation used for cachingT1
- , the relations which have been combinedT2
- , the relations which have been combined- Throws:
ReasoningException
SemReasonerException
InterruptedException
IOException
-
addRelation
Description copied from interface:Receiver
add a whole relation at the beginning- Specified by:
addRelation
in interfaceReceiver
- Parameters:
relation
- the relation to be added
-
getArity
public int getArity()Description copied from interface:Receiver
arity of the tuples -
getTupleStore
Description copied from interface:Receiver
get the basic tuple store- Specified by:
getTupleStore
in interfaceReceiver
- Returns:
- the tuple store
-
receiveRelation
public boolean receiveRelation(ReasoningRelation relation) throws ReasoningException, InterruptedException, IOException Description copied from interface:Receiver
receive a whole relation- Specified by:
receiveRelation
in interfaceReceiver
- Parameters:
relation
- the whole relation to be received- Returns:
- true, if relation is later on dissolved, false otherwise
- Throws:
ReasoningException
InterruptedException
IOException
-