class OntoParam{ String name; double coef; OntoParamGroup parent; public OntoParam(){ this("???", 0.0, null); } public OntoParam(String name, double coef, OntoParamGroup parent){ this.name=name; this.coef=coef; this.parent=parent; } public String toString(){ return name+" "+((int)(coef*100))/100.0; } double getActualCoef(){ if(parent==null){ return coef; } else { return coef*parent.getActualCoef(); } } }