|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectreasoner.OpQuery
public class OpQuery
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.
Field Summary | |
---|---|
private Concept |
c1
The first Concept |
private Concept |
c2
The second Concept |
private Concept |
d
|
private java.text.NumberFormat |
formatter
|
private Role |
is
|
private KnowledgeBase |
kb
The KnowledgeBase |
private java.util.Map<java.lang.String,java.lang.Double> |
lastvalues
The last value map, for incremental evaluation |
private java.lang.String |
operator
The operator |
private Quantifier |
q
The Quantifier |
private ConcreteConcept |
tc1
The first ConcreteConcept |
private ConcreteConcept |
tc2
The second ConcreteConcept |
Constructor Summary | |
---|---|
OpQuery(ConcreteConcept tc1,
java.lang.String operator,
ConcreteConcept tc2,
KnowledgeBase kb)
Constructor by two ConcreteConcepts, binary operator and KnowledgeBase |
|
OpQuery(Quantifier q,
ConcreteConcept tc1,
java.lang.String operator,
ConcreteConcept tc2,
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. |
Concept |
getC1()
|
Concept |
getC2()
|
Concept |
getD()
|
Role |
getIs()
|
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()
|
Quantifier |
getQ()
|
ConcreteConcept |
getTc1()
|
ConcreteConcept |
getTc2()
|
void |
setC1(Concept c1)
|
void |
setC2(Concept c2)
|
void |
setD(Concept d)
|
void |
setIs(Role r)
|
void |
setKb(KnowledgeBase kb)
|
void |
setLastvalues(java.util.Map<java.lang.String,java.lang.Double> lastvalues)
|
void |
setOperator(java.lang.String operator)
|
void |
setQ(Quantifier q)
|
void |
setTc1(ConcreteConcept tc1)
|
void |
setTc2(ConcreteConcept tc2)
|
java.lang.String |
toString()
Gives a String representation for this Query |
private Concept |
trap2Concept(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 |
---|
private ConcreteConcept tc1
private ConcreteConcept tc2
private Concept c1
private Concept c2
private Quantifier q
private java.lang.String operator
private KnowledgeBase kb
private java.util.Map<java.lang.String,java.lang.Double> lastvalues
private Role is
private Concept d
private java.text.NumberFormat formatter
Constructor Detail |
---|
public OpQuery(ConcreteConcept tc1, java.lang.String operator, ConcreteConcept tc2, KnowledgeBase kb)
tc1
- the first ConcreteConceptoperator
- the operatortc2
- the second ConcreteConceptkb
- the KnowledgeBasepublic OpQuery(Quantifier q, ConcreteConcept tc1, java.lang.String operator, ConcreteConcept tc2, KnowledgeBase kb)
q
- the Quantifiertc1
- the first ConcreteConceptoperator
- the operatortc2
- the second ConcreteConceptkb
- the KnowledgeBaseMethod Detail |
---|
private Concept trap2Concept(ConcreteConcept tc)
tc
- the ConcreteConcept
public double evaluate()
Query
evaluate
in interface Query
public java.lang.String evaluateString(boolean incremental)
incremental
- if true
then incremental evaluation
public java.lang.String getOperator()
public void setOperator(java.lang.String operator)
operator
- the operator to setpublic ConcreteConcept getTc1()
public void setTc1(ConcreteConcept tc1)
tc1
- the tc1 to setpublic ConcreteConcept getTc2()
public void setTc2(ConcreteConcept tc2)
tc2
- the tc2 to setpublic java.lang.String toString()
Query
toString
in interface Query
toString
in class java.lang.Object
public java.lang.String getMeaning()
Query
getMeaning
in interface Query
public KnowledgeBase getKb()
public void setKb(KnowledgeBase kb)
kb
- the kb to setpublic Concept getC1()
public void setC1(Concept c1)
c1
- the c1 to setpublic Concept getC2()
public void setC2(Concept c2)
c2
- the c2 to setpublic java.util.Map<java.lang.String,java.lang.Double> getLastvalues()
public void setLastvalues(java.util.Map<java.lang.String,java.lang.Double> lastvalues)
lastvalues
- the lastvalues to setpublic Quantifier getQ()
public void setQ(Quantifier q)
q
- the q to setpublic Concept getD()
public void setD(Concept d)
d
- the d to setpublic Role getIs()
public void setIs(Role r)
r
- the r to set
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |