51 lines
577 B
Java
51 lines
577 B
Java
|
package org.hwo;
|
||
|
|
||
|
public class Smoother {
|
||
|
|
||
|
private int summe;
|
||
|
private int wert;
|
||
|
private int tn;
|
||
|
|
||
|
public Smoother()
|
||
|
{
|
||
|
setSumme(0);
|
||
|
setWert(0);
|
||
|
setTn(1);
|
||
|
}
|
||
|
|
||
|
public int cycle(int value)
|
||
|
{
|
||
|
summe += value;
|
||
|
wert = summe / tn;
|
||
|
summe -= wert;
|
||
|
return wert;
|
||
|
}
|
||
|
|
||
|
public int getSumme() {
|
||
|
return summe;
|
||
|
}
|
||
|
|
||
|
public void setSumme(int summe) {
|
||
|
this.summe = summe;
|
||
|
}
|
||
|
|
||
|
public int getWert() {
|
||
|
return wert;
|
||
|
}
|
||
|
|
||
|
public void setWert(int wert) {
|
||
|
this.wert = wert;
|
||
|
}
|
||
|
|
||
|
public int getTn() {
|
||
|
return tn;
|
||
|
}
|
||
|
|
||
|
public void setTn(int tn) {
|
||
|
this.tn = tn;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
}
|