本文整理汇总了Java中ch.rgw.tools.TimeTool.isBefore方法的典型用法代码示例。如果您正苦于以下问题:Java TimeTool.isBefore方法的具体用法?Java TimeTool.isBefore怎么用?Java TimeTool.isBefore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ch.rgw.tools.TimeTool
的用法示例。
在下文中一共展示了TimeTool.isBefore方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getLatest
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private TimeTool getLatest(final Tree t){
if (t.contents instanceof Rechnung) {
return new TimeTool(((Rechnung) t.contents).getDatumRn());
} else if (t.contents instanceof Fall) {
return getLatestFromCase(t);
} else if (t.contents instanceof Patient) {
Tree runner = t.getFirstChild();
TimeTool latest = new TimeTool();
while (runner != null) {
TimeTool lff = getLatestFromCase(runner);
if (lff.isBefore(latest)) {
latest.set(lff);
}
runner = runner.getNextSibling();
}
return latest;
}
return null;
}
示例2: getLatestFromCase
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
private TimeTool getLatestFromCase(final Tree c){
List<Tree> tRn = (List<Tree>) c.getChildren();
TimeTool tL = new TimeTool();
for (Tree t : tRn) {
Rechnung rn = (Rechnung) t.contents;
TimeTool ttR = new TimeTool(rn.getDatumRn());
if (ttR.isBefore(tL)) {
tL.set(ttR);
}
}
return tL;
}
示例3: 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();
}
示例4: compare
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@Override
public int compare(Object o1, Object o2) {
int comp = 0;
if (o1 instanceof Fall && o2 instanceof Fall) {
Fall f1 = (Fall) o1;
Fall f2 = (Fall) o2;
// compare gesetz
boolean isFall1Closed = !f1.isOpen();
boolean isFall2Closed = !f2.isOpen();
comp = ObjectUtils.compare(isFall1Closed, isFall2Closed);
if (comp == 0) {
comp = ObjectUtils.compare(f1.getAbrechnungsSystem(), f2.getAbrechnungsSystem());
if (comp == 0) {
// compare beginn date
TimeTool t1 = new TimeTool(f1.getBeginnDatum());
TimeTool t2 = new TimeTool(f2.getBeginnDatum());
comp = t1.isEqual(t2) ? 0 : (t1.isBefore(t2) ? 1 : -1);
if (comp == 0) {
comp = ObjectUtils.compare(f1.getBezeichnung(), f2.getBezeichnung());
if (comp == 0) {
comp = ObjectUtils.compare(f1.getId(), f2.getId());
}
}
}
}
}
return comp;
}
示例5: determineDueState
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
* Determine the reminder respective due state for a given {@link TimeTool}
*
* @param dueDate
* @return
* @since 3.4 0 if not yet due (due in the future), 1 if due (due today), 2 if overdue (due in
* the past)
*/
public static int determineDueState(TimeTool dueDate){
if (dueDate != null) {
TimeTool now = new TimeTool();
if (dueDate.isBefore(now)) {
return 2;
}
if (dueDate.isEqual(now)) {
return 1;
}
}
return 0;
}
示例6: isStopped
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
* Check if the prescription is stopped at the time provided.
*
* @param time
* @return
*/
public boolean isStopped(TimeTool time){
String timestamp = checkNull(get(FLD_DATE_UNTIL));
if (!timestamp.isEmpty()) {
TimeTool timetool = new TimeTool(timestamp);
return timetool.isBefore(time);
}
return false;
}
示例7: getStatusAtDate
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
* Retrieve the state a bill had at a given moment
*
* @param date
* the time to consider
* @return the Status the bill had at this moment
*/
public int getStatusAtDate(TimeTool date){
List<String> trace = getTrace(Rechnung.STATUS_CHANGED);
int ret = getStatus();
TimeTool tt = new TimeTool();
for (String s : trace) {
String[] stm = s.split("\\s*:\\s");
if (tt.set(stm[0])) {
if (tt.isBefore(date)) {
ret = Integer.parseInt(stm[1]);
}
}
}
return ret;
}
示例8: getFirstKonsDate
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public static TimeTool getFirstKonsDate(Rechnung rechnung){
TimeTool ret = new TimeTool(TimeTool.END_OF_UNIX_EPOCH);
List<Konsultation> konsultationen = rechnung.getKonsultationen();
for (Konsultation konsultation : konsultationen) {
TimeTool tt = new TimeTool(konsultation.getDatum());
if (tt.isBefore(ret)) {
ret.set(tt);
}
}
return ret;
}
示例9: getRootTerminStartTime
import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
private TimeTool getRootTerminStartTime(Calendar cal){
TimeTool tt = new TimeTool(cal.getTime());
switch (seriesType) {
case DAILY:
return tt;
case WEEKLY:
Calendar cal2 = Calendar.getInstance();
cal2.setTime(cal.getTime());
int firstDay = Integer.parseInt(getSeriesPatternString().split(",")[1].charAt(0) + "");
cal2.set(Calendar.DAY_OF_WEEK, firstDay);
TimeTool ret = new TimeTool(cal2.getTime());
return ret;
case MONTHLY:
int monthDay = Integer.parseInt(seriesPatternString);
Calendar calendarMonth = Calendar.getInstance();
calendarMonth.clear();
calendarMonth.set(Calendar.YEAR, tt.get(TimeTool.YEAR));
if (tt.get(Calendar.DAY_OF_MONTH) <= monthDay) {
calendarMonth.set(Calendar.MONTH, tt.get(Calendar.MONTH));
} else {
calendarMonth.set(Calendar.MONTH, tt.get(Calendar.MONTH));
calendarMonth.add(Calendar.MONTH, 1);
}
calendarMonth.set(Calendar.DAY_OF_MONTH, monthDay);
return new TimeTool(calendarMonth.getTime());
case YEARLY:
Calendar targetCal = Calendar.getInstance();
targetCal.clear();
targetCal.set(Calendar.YEAR, tt.get(TimeTool.YEAR));
int day = Integer.parseInt(seriesPatternString.substring(0, 2));
int month = Integer.parseInt(seriesPatternString.substring(2, 4));
targetCal.set(Calendar.DAY_OF_MONTH, day);
targetCal.set(Calendar.MONTH, month - 1);
TimeTool target = new TimeTool(targetCal.getTime());
if (tt.isBefore(target))
return target;
target.add(TimeTool.YEAR, 1);
return target;
}
return tt;
}