Code example for Vector

Methods: add, get

0
			return null; 
		} 
 
		Calendar now = Calendar.getInstance();
 
		Vector<Calendar> targets = new Vector<Calendar>();
		targets.add(Calendar.getInstance());
		targets.add(Calendar.getInstance());
 
		targets.get(0).set(Calendar.SECOND, 0);
		targets.get(1).set(Calendar.SECOND, 0);
 
		// if(!trigDesc.isRandomized()) { 
		// target.set(Calendar.HOUR_OF_DAY, 
		// trigDesc.getTriggerTime().getHour()); 
		// target.set(Calendar.MINUTE, trigDesc.getTriggerTime().getMinute()); 
		// 
		// if(now.before(target)) { 
		// return target; 
		// } 
		// } 
		// else { //if randomized, check if there is any more time left in the 
		// interval 
		SimpleTime tCurr = new SimpleTime();
		SimpleTime tStart = trigDesc.getRangeStart();
		SimpleTime tEnd = trigDesc.getRangeEnd();
 
		if (tCurr.isBefore(tEnd))
		{ 
 
			// int eDiff; 
			// if(tCurr.isAfter(tStart)) { 
			// eDiff = tCurr.differenceInMinutes(tEnd); 
			targets.get(1).set(Calendar.HOUR_OF_DAY, tEnd.getHour());
			targets.get(1).set(Calendar.MINUTE, tEnd.getMinute());
		} 
		// else { 
		if (tCurr.isBefore(tStart))
		{ 
			// int sDiff = tCurr.differenceInMinutes(tStart); 
			targets.get(0).set(Calendar.HOUR_OF_DAY, tStart.getHour());
			targets.get(0).set(Calendar.MINUTE, tStart.getMinute());
		} 
 
		// Random rand = new Random(); 
		// Generate a random number (both ranges inclusive) 
		// target.add(Calendar.MINUTE, rand.nextInt(diff + 1));