remove setters, just use the fields

This commit is contained in:
Doug MacEachern 2004-11-22 02:07:37 +00:00
parent df88ea5bb4
commit 5a31d9cdab
1 changed files with 12 additions and 31 deletions

View File

@ -32,11 +32,11 @@ public class CpuPerc {
diffTotal = diffUser + diffSys + diffNice + diffIdle + diffWait; diffTotal = diffUser + diffSys + diffNice + diffIdle + diffWait;
CpuPerc perc = new CpuPerc(); CpuPerc perc = new CpuPerc();
perc.setUser(diffUser / diffTotal); perc.user = diffUser / diffTotal;
perc.setSys(diffSys / diffTotal); perc.sys = diffSys / diffTotal;
perc.setNice(diffNice / diffTotal); perc.nice = diffNice / diffTotal;
perc.setIdle(diffIdle / diffTotal); perc.idle = diffIdle / diffTotal;
perc.setWait(diffWait / diffTotal); perc.wait = diffWait / diffTotal;
return perc; return perc;
} }
@ -44,42 +44,22 @@ public class CpuPerc {
return this.user; return this.user;
} }
void setUser(double user){
this.user = user;
}
public double getSys() { public double getSys() {
return this.sys; return this.sys;
} }
void setSys(double sys){
this.sys = sys;
}
public double getNice() { public double getNice() {
return this.nice; return this.nice;
} }
void setNice(double nice){
this.nice = nice;
}
public double getIdle() { public double getIdle() {
return this.idle; return this.idle;
} }
void setIdle(double idle){
this.idle = idle;
}
public double getWait() { public double getWait() {
return this.wait; return this.wait;
} }
void setWait(double wait){
this.wait = wait;
}
public double getCombined() { public double getCombined() {
return this.user + this.sys; return this.user + this.sys;
} }
@ -100,6 +80,7 @@ public class CpuPerc {
format(this.user) + " user, " + format(this.user) + " user, " +
format(this.sys) + " system, " + format(this.sys) + " system, " +
format(this.nice) + " nice, " + format(this.nice) + " nice, " +
format(this.wait) + " wait, " +
format(this.idle) + " idle"; format(this.idle) + " idle";
} }
} }