ArrayList<Job> tempJobs = new ArrayList<Job>();
ArrayList<Job> jobs = new ArrayList<Job>();
Simulation simulation = new Simulation(now);
simulation.loadNewJobEvents();
if (file != null) {
simulation.setJobList(file);
jobs = simulation.getJobList();
simulation.setEventList();
} ArrayList<Event> eventList = simulation.getEventList();
if (now == 1) {
now = simulation.getNow();
}
for(int i=0;i<jobs.size();i++){
Job job = null;
job = jobs.get(i);
tempJobs.add(job);
}
Algorithm algorithm = new Algorithm(jobs, eventList, now);
boolean utilization = false;
if (eventList.isEmpty() != true ) {
log.info("now is " + now);
algorithm.iteratorEventList();
}
请问我如何才能使tempJobs 中的Job 对象 不发生变化,当后面的iteratorEventList() 方法执行以后,因为iteratorEventList()会改变jobs 。
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货