📄 fact.java
字号:
package expertSystem.knowledgeBase;
import java.util.ArrayList;
import java.util.List;
public class Fact {
public String factName;
public String atributeName;
public String value;
public boolean isQuestion;
public String question;
public List<String> answers;
public double probability;
public Fact(){
answers = new ArrayList<String>();
}
public Fact(String name){
this.factName=name;
answers = new ArrayList<String>();
}
public Fact(String _factName, String _atributeName, String _value){
this.atributeName = _atributeName;
this.factName = _factName;
this.value = _value;
answers = new ArrayList<String>();
}
public Fact(String _factName, String _atributeName, String _value, boolean _isQuestion, double _probability){
this.factName = _factName;
this.atributeName = _atributeName;
this.value = _value;
this.isQuestion = _isQuestion;
this.probability = _probability;
answers = new ArrayList<String>();
}
public Fact(String _factName, String _atributeName, String _value, boolean _isQuestion, String _question, List<String> _answers, double _probability){
this.factName = _factName;
this.atributeName = _atributeName;
this.value = _value;
this.isQuestion = _isQuestion;
this.question = _question;
this.probability = _probability;
this.answers = _answers;
}
public String getFactName(){
return this.factName;
}
public void setFactName(String _factName){
this.factName = _factName;
}
public String getAtributeName(){
return this.atributeName;
}
public void setfacteName(String _atributeName){
this.atributeName = _atributeName;
}
public String getValue(){
return this.value;
}
public void setValue(String _value){
this.value = _value;
}
public boolean getIsQestion(){
return this.isQuestion;
}
public void setIsQustion(boolean _isQuestion){
this.isQuestion = _isQuestion;
}
public void setQuestion(String _question){
this.question = _question;
}
public String getQuestion(){
return question;
}
public void setAnswers(List<String> answers) {
this.answers = answers;
}
public List<String> getAnswers() {
return this.answers;
}
public void setProbability(double probability) {
this.probability = probability;
}
public double getProbability() {
return this.probability;
}
public boolean smallEquals(Object o){
Fact f = (Fact) o;
if(this.factName.equalsIgnoreCase(f.factName)&&this.atributeName.equalsIgnoreCase(f.atributeName)&&this.value.equalsIgnoreCase(f.value))return true;
else return false;
}
@Override
public boolean equals(Object o){
Fact f = (Fact) o;
if(this.factName.equalsIgnoreCase(f.factName)&&this.atributeName.equalsIgnoreCase(f.atributeName))return true;
else return false;
}
@Override
public String toString(){
String SS="";
SS+=this.getFactName()+" ";
SS+=this.getAtributeName()+" ";
SS+=this.getValue()+" ";
return SS;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -