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


Java TimeTool.isAfterOrEqual方法代码示例

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


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

示例1: getMultiplikator

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public synchronized double getMultiplikator(TimeTool date){
	// get Mutliplikator for date
	fetchResultSet();
	Iterator<MultiplikatorInfo> iter = list.iterator();
	while (iter.hasNext()) {
		MultiplikatorInfo info = iter.next();
		TimeTool fromDate = new TimeTool(info.validFrom);
		TimeTool toDate = new TimeTool(info.validTo);
		if (date.isAfterOrEqual(fromDate) && date.isBeforeOrEqual(toDate)) {
			String value = info.multiplikator;
			if (value != null && !value.isEmpty()) {
				try {
					return Double.parseDouble(value);
				} catch (NumberFormatException nfe) {
					ExHandler.handle(nfe);
					return 0.0;
				}
			}
		}
	}
	return 1.0;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:23,代码来源:MultiplikatorList.java

示例2: getIdForCode

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public String getIdForCode(String lookupCode, TimeTool lookupValidFrom, String lookupLaw){
	List<TarmedLeistung> list = importedChapters.get(lookupCode);
	if (!list.isEmpty()) {
		if (list.size() == 1) {
			return list.get(0).getId();
		} else {
			// lookup matching by law and valid from
			for (TarmedLeistung tarmedLeistung : list) {
				String currLaw = tarmedLeistung.get(TarmedLeistung.FLD_LAW);
				TimeTool currValidFrom = tarmedLeistung.getGueltigVon();
				if (currValidFrom.isAfterOrEqual(lookupValidFrom)
					&& currLaw.equals(lookupLaw)) {
					return tarmedLeistung.getId();
				}
			}
			// fallback return latest
			TarmedLeistung latestLeistung = list.get(list.size() - 1);
			String latestLaw = latestLeistung.get(TarmedLeistung.FLD_LAW);
			if (latestLaw.equals(lookupLaw)) {
				return latestLeistung.getId();
			}
		}
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:26,代码来源:ChapterImporter.java

示例3: getFromCode

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * Load a {@link ComplementaryLeistung} from code that is valid at the date.
 * 
 * @param code
 * @param date
 * @return
 */
public static IVerrechenbar getFromCode(final String code, TimeTool date){
	Query<ComplementaryLeistung> query =
		new Query<ComplementaryLeistung>(ComplementaryLeistung.class, FLD_CODE, code, TABLENAME,
			new String[] {
				FLD_VALID_FROM, FLD_VALID_TO
			});
	List<ComplementaryLeistung> leistungen = query.execute();
	for (ComplementaryLeistung leistung : leistungen) {
		TimeTool validFrom = leistung.getValidFrom();
		TimeTool validTo = leistung.getValidTo();
		if (date.isAfterOrEqual(validFrom) && date.isBeforeOrEqual(validTo))
			return leistung;
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:23,代码来源:ComplementaryLeistung.java

示例4: doSelectByDate

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * Auwahl der Konsultationen, die verrechnet werden sollen, nach Datum. Es erscheint ein Dialog,
 * wo man den gewünschten Bereich wählen kann.
 */
@SuppressWarnings("unchecked")
private void doSelectByDate(final IProgressMonitor monitor, final TimeTool fromDate,
	final TimeTool toDate){
	TimeTool actDate = new TimeTool();
	
	// set dates to midnight
	TimeTool date1 = new TimeTool(fromDate);
	TimeTool date2 = new TimeTool(toDate);
	date1.chop(3);
	date2.add(TimeTool.DAY_OF_MONTH, 1);
	date2.chop(3);
	
	List<Tree> lAll = (List<Tree>) tAll.getChildren();
	monitor.beginTask(Messages.KonsZumVerrechnenView_selectByDateTask, lAll.size() + 1); //$NON-NLS-1$
	for (Tree tP : lAll) {
		monitor.worked(1);
		for (Tree tF : (List<Tree>) tP.getChildren()) {
			List<Tree> tK = (List<Tree>) tF.getChildren();
			for (Tree tk : tK) {
				Konsultation k = (Konsultation) tk.contents;
				actDate.set(k.getDatum());
				if (actDate.isAfterOrEqual(date1) && actDate.isBefore(date2)) {
					selectBehandlung((Konsultation) tk.contents, tAll, tSelection);
				}
			}
			if (monitor.isCanceled()) {
				monitor.done();
				return;
			}
		}
	}
	monitor.done();
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:38,代码来源:KonsZumVerrechnenView.java

示例5: getFromCode

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public static Labor2009Tarif getFromCode(String code, TimeTool date){
	Query<Labor2009Tarif> query = new Query<Labor2009Tarif>(Labor2009Tarif.class);
	query.add(Labor2009Tarif.FLD_CODE, "=", code);
	List<Labor2009Tarif> leistungen = query.execute();
	for (Labor2009Tarif laborLeistung : leistungen) {
		TimeTool validFrom = laborLeistung.getGueltigVon();
		TimeTool validTo = laborLeistung.getGueltigBis();
		if (validTo == null) {
			validTo = future;
		}
		if (date.isAfterOrEqual(validFrom) && date.isBeforeOrEqual(validTo))
			return laborLeistung;
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:16,代码来源:Labor2009Tarif.java

示例6: getFromCode

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * Query for a {@link TarmedLeistung} using the code. The returned {@link TarmedLeistung} will
 * be valid on date, and will be from the cataloge specified by law.
 * 
 * @param code
 * @param date
 * @param law
 * @return null if no matching {@link TarmedLeistung} found
 * @since 3.4
 */
public static IVerrechenbar getFromCode(@NonNull
final String code, @NonNull TimeTool date, @Nullable String law){
	if (availableLawsCache == null) {
		availableLawsCache = getAvailableLaws();
	}
	Query<TarmedLeistung> query = new Query<TarmedLeistung>(TarmedLeistung.class, FLD_CODE,
		code, TarmedLeistung.TABLENAME, new String[] {
			TarmedLeistung.FLD_GUELTIG_VON, TarmedLeistung.FLD_GUELTIG_BIS,
			TarmedLeistung.FLD_LAW, TarmedLeistung.FLD_ISCHAPTER
		});
	if (law != null) {
		if (!isAvailableLaw(law)) {
			query.startGroup();
			query.add(FLD_LAW, Query.EQUALS, "");
			query.or();
			query.add(FLD_LAW, Query.EQUALS, null);
			query.endGroup();
		} else {
			query.add(FLD_LAW, Query.EQUALS, law, true);
		}
	}
	List<TarmedLeistung> leistungen = query.execute();
	for (TarmedLeistung tarmedLeistung : leistungen) {
		TimeTool validFrom = tarmedLeistung.getGueltigVon();
		TimeTool validTo = tarmedLeistung.getGueltigBis();
		if (date.isAfterOrEqual(validFrom) && date.isBeforeOrEqual(validTo))
			return tarmedLeistung;
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:41,代码来源:TarmedLeistung.java

示例7: getValidValueMaps

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * Get a List of Maps containing the rows of the ResultSet with a matching valid date
 * information. This is needed as we can not make constraints on a date represented as string in
 * the db.
 * 
 * @param input
 * @param validFrom
 * @return
 * @throws SQLException
 */
public static List<Map<String, String>> getValidValueMaps(ResultSet input, TimeTool validFrom)
	throws SQLException, IOException{
	List<Map<String, String>> ret = new ArrayList<Map<String, String>>();
	
	// build list of column names
	ArrayList<String> headers = new ArrayList<String>();
	ResultSetMetaData meta = input.getMetaData();
	int metaLength = meta.getColumnCount();
	for (int i = 1; i <= metaLength; i++) {
		headers.add(meta.getColumnName(i));
	}
	
	TimeTool from = new TimeTool();
	TimeTool to = new TimeTool();
	
	// find rows with matching valid date information
	while (input.next()) {
		from.set(input.getString("GUELTIG_VON"));
		to.set(input.getString("GUELTIG_BIS")); //$NON-NLS-1$
		// is this the correct result
		if (validFrom.isAfterOrEqual(from) && validFrom.isBeforeOrEqual(to)) {
			HashMap<String, String> valuesMap = new HashMap<String, String>();
			// put all the columns with values into valuesMap
			for (String columnName : headers) {
				String value = input.getString(columnName);
				valuesMap.put(columnName, value);
			}
			// add map to list of matching maps
			ret.add(valuesMap);
		}
	}
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:44,代码来源:ImporterUtil.java

示例8: isValidKumulation

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * Checks if the kumulation is still/already valid on the given date
 * 
 * @param date
 *            on which it should be valid
 * @return true if valid, false otherwise
 */
public boolean isValidKumulation(TimeTool date){
	TimeTool from = new TimeTool(getValidFrom());
	TimeTool to = new TimeTool(getValidTo());
	
	if (date.isAfterOrEqual(from) && date.isBeforeOrEqual(to)) {
		return true;
	}
	return false;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:17,代码来源:TarmedKumulation.java

示例9: validAt

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public boolean validAt(TimeTool validTime){
	TimeTool validFrom = new TimeTool(get(FLD_VALIDFROM));
	TimeTool validTo = new TimeTool(get(FLD_VALIDTO));
	return validTime.isAfterOrEqual(validFrom) && validTime.isBeforeOrEqual(validTo);
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:6,代码来源:TarmedGroup.java


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