reasoner
Class OpQuery

java.lang.Object
  extended by reasoner.OpQuery
All Implemented Interfaces:
reasoner.Query

public class OpQuery
extends java.lang.Object
implements reasoner.Query

This class represents a Query in the form (Q)AopB, where A and B are ConcreteConcept, op is binary operator between Concepts and Q is Quantifier.

Author:
marco furlan

Field Summary
private  reasoner.Concept c1
           
private  reasoner.Concept c2
           
private  reasoner.Concept d
           
private  java.text.NumberFormat formatter
           
private  reasoner.Role is
           
private  reasoner.KnowledgeBase kb
           
private  java.util.Map<java.lang.String,java.lang.Double> lastvalues
           
private  java.lang.String operator
           
private  reasoner.Quantifier q
           
private  reasoner.ConcreteConcept tc1
          The first ConcreteConcept
private  reasoner.ConcreteConcept tc2
          The first ConcreteConcept
 
Constructor Summary
OpQuery(reasoner.ConcreteConcept tc1, java.lang.String operator, reasoner.ConcreteConcept tc2, reasoner.KnowledgeBase kb)
          Constructor by two ConcreteConcepts, binary operator and KnowledgeBase
OpQuery(reasoner.Quantifier q, reasoner.ConcreteConcept tc1, java.lang.String operator, reasoner.ConcreteConcept tc2, reasoner.KnowledgeBase kb)
          Constructor by Quantifier, two ConcreteConcepts, binary operator and KnowledgeBase
 
Method Summary
 double evaluate()
          Evaluates this Query.
 java.lang.String evaluateString(boolean incremental)
          Evaluates this OpQuery and returns a String result.
 reasoner.Concept getC1()
           
 reasoner.Concept getC2()
           
 reasoner.Concept getD()
           
 reasoner.Role getIs()
           
 reasoner.KnowledgeBase getKb()
           
 java.util.Map<java.lang.String,java.lang.Double> getLastvalues()
           
 java.lang.String getMeaning()
          Gives a String about this Query meaning
 java.lang.String getOperator()
           
 reasoner.Quantifier getQ()
           
 reasoner.ConcreteConcept getTc1()
           
 reasoner.ConcreteConcept getTc2()
           
 void setC1(reasoner.Concept c1)
           
 void setC2(reasoner.Concept c2)
           
 void setD(reasoner.Concept d)
           
 void setIs(reasoner.Role r)
           
 void setKb(reasoner.KnowledgeBase kb)
           
 void setLastvalues(java.util.Map<java.lang.String,java.lang.Double> lastvalues)
           
 void setOperator(java.lang.String operator)
           
 void setQ(reasoner.Quantifier q)
           
 void setTc1(reasoner.ConcreteConcept tc1)
           
 void setTc2(reasoner.ConcreteConcept tc2)
           
 java.lang.String toString()
          Gives a String representation for this Query
private  reasoner.Concept trap2Concept(reasoner.ConcreteConcept tc)
          Converts a ConcreteConcept in a Concept
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tc1

private reasoner.ConcreteConcept tc1
The first ConcreteConcept


tc2

private reasoner.ConcreteConcept tc2
The first ConcreteConcept


c1

private reasoner.Concept c1

c2

private reasoner.Concept c2

d

private reasoner.Concept d

is

private reasoner.Role is

q

private reasoner.Quantifier q

operator

private java.lang.String operator

kb

private reasoner.KnowledgeBase kb

lastvalues

private java.util.Map<java.lang.String,java.lang.Double> lastvalues

formatter

private java.text.NumberFormat formatter
Constructor Detail

OpQuery

public OpQuery(reasoner.ConcreteConcept tc1,
                 java.lang.String operator,
                 reasoner.ConcreteConcept tc2,
                 reasoner.KnowledgeBase kb)
Constructor by two ConcreteConcepts, binary operator and KnowledgeBase

Parameters:
tc1 - the first ConcreteConcept
operator - the operator
tc2 - the second ConcreteConcept
kb - the KnowledgeBase

OpQuery

public OpQuery(reasoner.Quantifier q,
                 reasoner.ConcreteConcept tc1,
                 java.lang.String operator,
                 reasoner.ConcreteConcept tc2,
                 reasoner.KnowledgeBase kb)
Constructor by Quantifier, two ConcreteConcepts, binary operator and KnowledgeBase

Parameters:
q - the Quantifier
tc1 - the first ConcreteConcept
operator - the operator
tc2 - the second ConcreteConcept
kb - the KnowledgeBase
Method Detail

trap2Concept

private reasoner.Concept trap2Concept(reasoner.ConcreteConcept tc)
Converts a ConcreteConcept in a Concept

Parameters:
tc - the ConcreteConcept
Returns:
the Concept

evaluate

public double evaluate()
Description copied from interface: reasoner.Query
Evaluates this Query.

Specified by:
evaluate in interface reasoner.Query
Returns:
the result

evaluateString

public java.lang.String evaluateString(boolean incremental)
Evaluates this OpQuery and returns a String result.

Parameters:
incremental - if true then incremental evaluation
Returns:
the result

getOperator

public java.lang.String getOperator()
Returns:
the operator

setOperator

public void setOperator(java.lang.String operator)
Parameters:
operator - the operator to set

getTc1

public reasoner.ConcreteConcept getTc1()
Returns:
the tc1

setTc1

public void setTc1(reasoner.ConcreteConcept tc1)
Parameters:
tc1 - the tc1 to set

getTc2

public reasoner.ConcreteConcept getTc2()
Returns:
the tc2

setTc2

public void setTc2(reasoner.ConcreteConcept tc2)
Parameters:
tc2 - the tc2 to set

toString

public java.lang.String toString()
Description copied from interface: reasoner.Query
Gives a String representation for this Query

Specified by:
toString in interface reasoner.Query
Overrides:
toString in class java.lang.Object
Returns:
the String

getMeaning

public java.lang.String getMeaning()
Description copied from interface: reasoner.Query
Gives a String about this Query meaning

Specified by:
getMeaning in interface reasoner.Query
Returns:
the meaning

getKb

public reasoner.KnowledgeBase getKb()
Returns:
the kb

setKb

public void setKb(reasoner.KnowledgeBase kb)
Parameters:
kb - the kb to set

getC1

public reasoner.Concept getC1()
Returns:
the c1

setC1

public void setC1(reasoner.Concept c1)
Parameters:
c1 - the c1 to set

getC2

public reasoner.Concept getC2()
Returns:
the c2

setC2

public void setC2(reasoner.Concept c2)
Parameters:
c2 - the c2 to set

getLastvalues

public java.util.Map<java.lang.String,java.lang.Double> getLastvalues()
Returns:
the lastvalues

setLastvalues

public void setLastvalues(java.util.Map<java.lang.String,java.lang.Double> lastvalues)
Parameters:
lastvalues - the lastvalues to set

getQ

public reasoner.Quantifier getQ()
Returns:
the q

setQ

public void setQ(reasoner.Quantifier q)
Parameters:
q - the q to set

getD

public reasoner.Concept getD()
Returns:
the d

setD

public void setD(reasoner.Concept d)
Parameters:
d - the d to set

getIs

public reasoner.Role getIs()
Returns:
the is

setIs

public void setIs(reasoner.Role r)
Parameters:
r - the r to set