I am new to java, I have a class HashSet<Proposition>Propositions
,
class Proposition have 4 class Variable:
public class Proposition extends HashSet<Proposition> implements RSTNode{
private String productName;
private Property property;
private Serializable value;
private Type type;
private Rating rating;
}
and class Propositions
is as follow:
public class Propositions extends ArrayList<Proposition>{
........
}
I have class RST Rule
as follow:
public class RSTRule{
protected String ruleName;
protected String discourseRelation;
protected RSTNode nucleus;
protected RSTNode satellite;
protected Condition condition;
int heuristic;
}
now i have another class namely RSTRules,
which contains some methods such as generate_1(),generate_2(),... in this methods i want to write some condition in field condition, which if this condition is true then i should run the related generate methode but if condition is not true i should go to another generate methode and check it's condition an so on,
I thought for this propblem i should have a seperate class namely "Condition" to check condition, but i do not know how should write the methods in Condition Class or Constructors also, that means my Condition Class is empty now!!!!!!
public class RSTRules extends ArrayList<RSTRule> {
RSTRule rstRule=new RSTRule();
Proposition prop1= new Proposition();
Proposition prop2= new Proposition();
public RSTRule generate_1(){
my condition for generate_1() is like this:if(prop1.getName().equals.prop2.getName();
rstRule.condition=.....
rstRule.satellite=propSat;
rstRule.nucleus=propNuc;
rstRule.ruleName="BothSatisfy_ProductsSimilarities"
rstRule.discourseRelation="Similarity"
rstRule.heuristic=10;
return rstRule;
}
public RSTRule generate_2(){
my condition for generate_2() is like this: if(prop1.getValue().equals.prop2.getValue()
rstRule.condition=.....
rstRule.satellite=propSat;
rstRule.nucleus=propNuc;
rstRule.ruleName="BothFunction"
rstRule.discourseRelation="Similarity"
rstRule.heuristic=10;
return rstRule;
}
}