/**
* <一句话功能简述> 创建表格数据 <功能详细描述> [参数说明]
*
* @return void [返回类型说明]
* @exception throws [违例类型] [违例说明]
* @see [类、类#方法、类#成员]
*/
private void createSourceData()
{
Object[] dataSour;
lstData = new LinkedHashMap<Long, Object[]>();
// lstTime = new ArrayList<String>();
lstTime = listTimeRange;
int index = 0;
long time = 0;
int taskIndex = 0;
for (final IndexValue inValue : list)
{
time = inValue.getBeginTime().getTime();
if (lstData.containsKey(time))
{
dataSour = lstData.get(time);
}
else
{
dataSour = new Object[col];
dataSour[0] = inValue.getBeginTime().toString();
lstTime.add(inValue.getBeginTime().toString());
}
taskIndex = probeIndexMap.get(inValue.getTaskID());
index = inValue.getStatDataType();
final int three = 3;
dataSour[taskIndex * three + index] = getValue(inValue.toString());
lstData.put(time, dataSour);
}
}
/**
* <一句话功能简述>清空内存多余数据 <功能详细描述>
*
* @see [类、类#方法、类#成员]
*/
public void clearData()
{
if (null != lstData && !lstData.isEmpty())
{
lstData.clear();
}
lstData = null;
if (null != lstTime && !lstTime.isEmpty())
{
lstTime.clear();
}
lstTime = null;
if (null != lstChartData && !lstChartData.isEmpty())
{
lstChartData.clear();
}
lstChartData = null;
}
/**
* <一句话功能简述> <功能详细描述> [参数说明]
*
* @see [类、类#方法、类#成员]
*/
public void createChartData()
{
Iterator<Entry<Long, Object[]>> itor;
String colName;
Entry<Long, Object[]> entry;
List<Double> chartData;
lstChartData = new ArrayList<ChartInfo>();
ChartInfo chartInfo;
for (int i = 1; i < col; i++)
{
colName = listColumn.get(i);
chartData = new ArrayList<Double>();
chartInfo = new ChartInfo();
if (colName.indexOf(resMap.getString("Common.label.table.avg")) != -1)
{
chartInfo.setShow(true);
}
else
{
chartInfo.setShow(false);
}
chartInfo.setName(colName);
for (itor = lstData.entrySet().iterator(); itor.hasNext();)
{
entry = itor.next();
chartData.add((Double)entry.getValue()[i]);
}
chartInfo.setData(chartData);
lstChartData.add(chartInfo);
}
}
09-15