如何查看其他三个对象属性?我需要检查每个三个属性是否不等于null,然后对每个三个语句执行一些操作。很多if语句
if(current.getValue()>0)
{
serie = fChart
.createSeries()
.setName(current.getLabel())
.setPoints(
new Number[]{
{t.getTime(),
current.getValue()}
Chart.addSeries(serie);
我需要检查它在接下来的两个语句,
if(current1.getValue()>0)
then do something for the serie1, and
if(current2.getValue()>0)
then do something for the serie2
我想它来写,如:
if (current.getValue() > 0) {
serie = fChart
.createSeries()
.setName(current.getLabel())
.setPoints(
new Number[] {
{
t.getTime(),
current.getValue() }
Chart.addSeries(serie);
}
if (current1.getValue() > 0) {
serie1 = fChart
.createSeries()
.setName(current.getLabel1())
.setPoints(
new Number[] {
{t.getTime(),
current1.getValue1() }
Chart.addSeries(serie1);
}
if (current2.getValue() > 0) {
serie2 = fChart
.createSeries()
.setName(current.getLabel2())
.setPoints(
new Number[] {
{t.getTime(),
current2.getValue2() }
Chart.addSeries(serie2);
}
但它不似乎工作,有什么建议?
请修复缩进。 – 2014-10-07 12:31:17
请格式化此代码... – 2014-10-07 12:32:05
'但它似乎并不工作'什么是问题? – Brandon 2014-10-07 12:33:01