当前位置: 首页>>代码示例>>Java>>正文


Java TimeTool.addMinutes方法代码示例

本文整理汇总了Java中ch.rgw.tools.TimeTool.addMinutes方法的典型用法代码示例。如果您正苦于以下问题:Java TimeTool.addMinutes方法的具体用法?Java TimeTool.addMinutes怎么用?Java TimeTool.addMinutes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.rgw.tools.TimeTool的用法示例。


在下文中一共展示了TimeTool.addMinutes方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: toString

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public String toString(final int level){
	String[] vals = new String[4];
	get(new String[] {
		FLD_TAG, FLD_DAUER, FLD_BEGINN, FLD_BEREICH
	}, vals);
	TimeTool d = new TimeTool(vals[0]);
	d.addMinutes(checkZero(vals[2]));
	String f = d.toString(TimeTool.WEEKDAY) + ", " + d.toString(TimeTool.LARGE_GER); //$NON-NLS-1$
	if (level > 0) {
		d.addMinutes(checkZero(vals[1]));
		f += "-" + d.toString(TimeTool.TIME_SMALL);
	}
	if (level > 1) {
		f += " (" + vals[3] + ")";
		
	}
	return f;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:19,代码来源:Termin.java

示例2: getStartTime

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public TimeTool getStartTime(){
	String[] res = new String[2];
	get(new String[] {
		FLD_TAG, FLD_BEGINN
	}, res);
	TimeTool start = new TimeTool(res[0]);
	start.addMinutes(checkZero(res[1]));
	return start;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:10,代码来源:Termin.java

示例3: getTimeSpan

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public TimeSpan getTimeSpan(){
	String[] res = new String[3];
	get(new String[] {
		FLD_TAG, FLD_BEGINN, FLD_DAUER
	}, res);
	TimeTool start = new TimeTool(res[0]);
	start.addMinutes(checkZero(res[1]));
	return new TimeSpan(start, checkZero(res[2]));
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:10,代码来源:Termin.java

示例4: getEndTime

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@Override
public TimeTool getEndTime(){
	String[] vals = new String[3];
	get(new String[] {
		FLD_TAG, FLD_BEGINN, FLD_DAUER
	}, vals);
	TimeTool ret = new TimeTool(vals[0]);
	ret.addMinutes(checkZero(vals[1]));
	ret.addMinutes(checkZero(vals[2]));
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:12,代码来源:Termin.java

示例5: writeSubsequentDateEntry

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
private void writeSubsequentDateEntry(TimeTool dateIncrementer){
	TimeTool endTime = new TimeTool(dateIncrementer);
	endTime.addMinutes(getAppointmentDuration());
	
	TimeSpan ts = new TimeSpan(dateIncrementer, endTime);
	Termin t = new Termin(Activator.getDefault().getActResource(), ts, "series");
	t.set(Termin.FLD_LINKGROUP, groupId);
	
	System.out.println("writing subsequent date entry " + endTime.dump());
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:11,代码来源:SerienTermin.java

示例6: createRootDate

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
private void createRootDate(){
	Calendar cal = Calendar.getInstance();
	cal.clear();
	cal.setTime(seriesStartDate);
	cal.add(Calendar.HOUR, beginTime.getHours());
	cal.add(Calendar.MINUTE, beginTime.getMinutes());
	
	TimeTool startTime = getRootTerminStartTime(cal);
	
	TimeTool endTime = new TimeTool(startTime);
	endTime.addMinutes(getAppointmentDuration());
	
	TimeSpan ts = new TimeSpan(startTime, endTime);
	rootTermin = new Termin(Activator.getDefault().getActResource(), ts, "series");
	
	groupId = rootTermin.getId();
	rootTermin.set(Termin.FLD_LINKGROUP, groupId);
	if (contact != null) {
		rootTermin.setKontakt(contact);
	} else {
		rootTermin.set(Termin.FLD_PATIENT, getFreeText());
	}
	
	rootTermin.setGrund(reason);	
	rootTermin.set(Termin.FLD_CREATOR, ElexisEventDispatcher.getSelected(User.class).getLabel());
	rootTermin.set(Termin.FLD_EXTENSION, this.toString());
	
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:29,代码来源:SerienTermin.java

示例7: okPressed

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@Override
protected void okPressed(){
	von.setTimeInMillis(dpVon.getDate().getTime());
	bis.setTimeInMillis(dpBis.getDate().getTime());
	Query<Termin> qbe = new Query<Termin>(Termin.class);
	qbe.add(Termin.FLD_TAG, Query.GREATER_OR_EQUAL, von.toString(TimeTool.DATE_COMPACT));
	qbe.add(Termin.FLD_TAG, Query.LESS_OR_EQUAL, bis.toString(TimeTool.DATE_COMPACT));
	qbe.add(Termin.FLD_BEREICH, Query.EQUALS, m);
	List<Termin> termine = qbe.execute();
	String fname = lFile.getText();
	if (fname.toLowerCase().endsWith(".csv")) { //$NON-NLS-1$
		new CSVExporter().doExport(fname, termine);
	} else {
		TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance().createRegistry();
		TimeZone timezone = registry.getTimeZone("Europe/Zurich"); //$NON-NLS-1$
		VTimeZone tz = timezone.getVTimeZone();
		Calendar calendar = new Calendar();
		calendar.getProperties().add(new ProdId("-//ch.elexis//Elexis v" + CoreHub.Version)); //$NON-NLS-1$
		calendar.getProperties().add(Version.VERSION_2_0);
		calendar.getProperties().add(CalScale.GREGORIAN);
		for (Termin t : termine) {
			if ((t.getStartMinute() == 0) && (t.getType().equals(Termin.typReserviert()))) {
				continue;
			}
			if ((t.getStartMinute() + t.getDurationInMinutes() == (23 * 60) + 59)
				&& (t.getType().equals(Termin.typReserviert()))) {
				continue;
			}
			TimeTool tt = new TimeTool(t.getStartTime());
			DateTime start = new DateTime(tt.getTime());
			tt.addMinutes(t.getDurationInMinutes());
			DateTime end = new DateTime(tt.getTime());
			VEvent vTermin = new VEvent(start, end, t.getPersonalia());
			vTermin.getProperties().add(tz.getTimeZoneId());
			Uid uid = new Uid(t.getId());
			vTermin.getProperties().add(uid);
			Description desc = new Description(t.getGrund());
			vTermin.getProperties().add(desc);
			calendar.getComponents().add(vTermin);
		}
		try {
			FileOutputStream fout = new FileOutputStream(lFile.getText());
			CalendarOutputter outputter = new CalendarOutputter();
			outputter.output(calendar, fout);
			
		} catch (Exception ex) {
			ExHandler.handle(ex);
			SWTHelper.alert(
				Messages.ICalTransfer_iOError,
				MessageFormat.format(Messages.ICalTransfer_couldNotWriteFile,
					lFile.getText()));
		}
	}
	super.okPressed();
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:56,代码来源:ICalTransfer.java

示例8: collidesWithLockTimes

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public boolean collidesWithLockTimes(){
	Calendar cal = Calendar.getInstance();
	cal.clear();
	cal.setTime(seriesStartDate);
	cal.add(Calendar.HOUR, beginTime.getHours());
	cal.add(Calendar.MINUTE, beginTime.getMinutes());
	TimeTool startTime = getRootTerminStartTime(cal);
	
	TimeTool endTime = new TimeTool(startTime);
	endTime.addMinutes(getAppointmentDuration());
	
	TimeSpan ts = new TimeSpan(startTime, endTime);
	rootTermin = new Termin(Activator.getDefault().getActResource(), ts, "series");
	TimeTool dateIncrementer = rootTermin.getStartTime();
	
	List<TimeTool> seriesTimesList = getAllTimesOfSeries(dateIncrementer);
	String bereich = Activator.getDefault().getActResource();
	
	for (TimeTool sTime : seriesTimesList) {
		TimeTool eTime = new TimeTool(sTime);
		eTime.addMinutes(getAppointmentDuration());
		TimeSpan span = new TimeSpan(sTime, eTime);
		
		// get all appointments where type=locked and day=X and bereich=y
		Query<Termin> qbe = new Query<Termin>(Termin.class);
		qbe.add(Termin.FLD_TERMINTYP, Query.EQUALS,
			ch.elexis.agenda.Messages.Termin_range_locked);
		qbe.add(Termin.FLD_TAG, Query.EQUALS, sTime.toString(TimeTool.DATE_COMPACT));
		qbe.add(Termin.FLD_BEREICH, Query.EQUALS, bereich);
		qbe.add(Termin.FLD_DELETED, Query.EQUALS, "0");
		List<Termin> locks = qbe.execute();
		
		for (Termin lockTermin : locks) {
			TimeSpan lockSpan = lockTermin.getTimeSpan();
			
			if (lockSpan.overlap(span) != null) {
				rootTermin.delete(false);
				return true;
			}
		}
	}
	
	//clean up
	rootTermin.delete(false);
	return false;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:47,代码来源:SerienTermin.java


注:本文中的ch.rgw.tools.TimeTool.addMinutes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。