sourceAry---取最早开始时间

/**抓取切割之后的一级包材工位序号最早开始时间*/
//key=包材+工位+序号,value=开始时间
Map<String,Date> supStartime = 
	new HashMap<String,Date>();
Date startTime = null;//记录最早开始时间
//记录开始时间,做排序后取最早的时间
Object[] sourceAry = null;
Iterator<Entry<String, List<Object[]>>> iff = 
	firstLocNo.entrySet().iterator();
while(iff.hasNext()){
	Entry<String, List<Object[]>> entry = iff.next();
	lotinfosNew = entry.getValue();
	sourceAry = new Object[lotinfosNew.size()];
	forNums = 0;
	for(Object[] obj : lotinfosNew){
		sourceAry[forNums] = MyUtils.
			formatStrYmdhm(obj[1].toString());
		forNums++;
	}
	sourceAry = MyUtils.dateAry(sourceAry);
	startTime = (Date) sourceAry[sourceAry.length-1];
	supStartime.put(entry.getKey(), startTime);
}

//----------------------------------------------------------
 public static Object[] dateAry(Object[] sourceAry){
//  Date[] sourceAry = {"2","6","4","8","3","1"};
	for (int i = 1; i < sourceAry.length; i++) {
		for (int j = 0; j < i; j++) {
			if(((Date) sourceAry[i]).compareTo((Date) sourceAry[j])>0){
				Date temp = (Date) sourceAry[i];
				sourceAry[i]=sourceAry[j];
				sourceAry[j]=temp;
			}
		}
	}
	return sourceAry; 
}

 

你可能感兴趣的:(source)