} catch (NetException ne) {
ne.printStackTrace();
return;
}
JobInfoList list = new LinkedJobInfoList(3, true);
QueuePutStrategy putStrategy_H = new HeadStrategy();
QueuePutStrategy putStrategy_T = new TailStrategy();
QueuePutStrategy putStrategy_HP = new HeadStrategyPriority();
QueuePutStrategy putStrategy_TP = new TailStrategyPriority();
QueuePutStrategy putStrategy = null;
switch (strategy) {
case STRATEGY_HEAD:
putStrategy = putStrategy_H;
break;
case STRATEGY_TAIL:
putStrategy = putStrategy_T;
break;
case STRATEGY_HEAD_PRIORITY:
putStrategy = putStrategy_HP;
break;
case STRATEGY_TAIL_PRIORITY:
putStrategy = putStrategy_TP;
break;
}
Job[] jobs = new Job[10];
jobs[0] = new Job(class1);
jobs[1] = new Job(class3);
jobs[2] = new Job(class2);
jobs[3] = new Job(class2);
jobs[4] = new Job(class1);
jobs[5] = new Job(class1);
jobs[6] = new Job(class1);
jobs[7] = new Job(class2);
jobs[8] = new Job(class3);
jobs[9] = new Job(class3);
byte b = 0x01;
for (Job job : jobs) {
try {
putStrategy.put(job, list, b, null, null);
} catch (NetException ne) {
ne.printStackTrace();
return;
}
}
//print
ListIterator iterator = list.getJobList().listIterator();
JobInfo current = null;
String className;
int classPr, jobID;
String strategyType = "";