String units; for (Object object : list) { LiveParam liveParam = new LiveParam(); Object data[] = (Object[]) object; // liveParam.setPramCode(data[0].toString()); liveParam.setPramDispName(data[0].toString()); // because of UI use issues i make it this double parValue = Double.parseDouble(data[1].toString()); int iValue = 0; units = data[5].toString(); if ((parValue * 100) % 100 == 0) { iValue = (int) parValue; if (units.equals("STATUSONOFF")) { if (iValue == 0) { liveParam.setPramValue("<img src='images/off.gif'/>"); liveParam.setUnits("OFF"); } else { liveParam.setPramValue("<img src='images/on.gif'/>"); liveParam.setUnits("ON"); } } else if (units.equals("STATUSYESNO")) { if (iValue == 0) { liveParam.setPramValue("<img src='image/off.gif'/>"); liveParam.setUnits("NO"); } else { liveParam.setPramValue("<img src='image/on.gif'/>"); liveParam.setUnits("YES"); } } else { liveParam.setPramValue(iValue+""); liveParam.setUnits(units); } } else { liveParam.setPramValue(parValue + ""); liveParam.setUnits(units); } liveParam.setPramType(data[2].toString()); liveParam.setTimestamp(Utility.getFormattedTimeStamp( (Timestamp) data[3], Constants.DATE_TIME_FORMAT)); liveParam.setCommunicationMedia(data[4].toString()); liveparamList.add(liveParam); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)