Examples of minus()


Examples of org.libreplan.business.calendars.entities.Capacity.minus()

    @Test
    public void testMinusWithZeroExtraHours() {
        Capacity c = Capacity.create(hours(8)).notOverAssignableWithoutLimit();

        assertThat(c.minus(hours(6)).getStandardEffort(), equalTo(hours(2)));
        assertThat(c.minus(hours(8)).getStandardEffort(), equalTo(hours(0)));
        assertThat(c.minus(hours(10)).getStandardEffort(), equalTo(hours(0)));
        assertFalse(c.minus(hours(6)).isOverAssignableWithoutLimit());

    }
View Full Code Here

Examples of org.libreplan.business.workingday.EffortDuration.minus()

        List<ResourceWithAssignedDuration> result = new ArrayList<ResourceWithAssignedDuration>();
        for (ResourceWithAvailableCapacity each : fromMoreToLessCapacity) {
            if (!each.available.isZero()) {
                ResourceWithAssignedDuration r = each
                        .doBiggestAssignationPossible(remaining);
                remaining = remaining.minus(r.duration);
                if (!r.duration.isZero()) {
                    result.add(r);
                }
            }
        }
View Full Code Here

Examples of org.mifosplatform.organisation.monetary.domain.Money.minus()

                endOfDayBalance = endOfDayBalance.plus(getAmount(currency));
                // }
            } else if (isWithdrawal() || isChargeTransactionAndNotReversed()) {
                // endOfDayBalance = openingBalance.minus(getAmount(currency));
                if (endOfDayBalance.isGreaterThanZero()) {
                    endOfDayBalance = endOfDayBalance.minus(getAmount(currency));
                } else {
                    endOfDayBalance = Money.of(currency, this.runningBalance);
                }
            }
        }
View Full Code Here

Examples of org.threeten.bp.Instant.minus()

      List<ConfigDocument> replacement = newArrayList();
      for (int i = 1; i <= 4; i++) {
        String val = "replace_" + i;
        ConfigDocument doc = new ConfigDocument(ConfigItem.of(val, "some_name_"+i));

        doc.setVersionFromInstant(now.minus(60, SECONDS).plus(i * 30, SECONDS));
        replacement.add(doc);
      }
      replacement.get(replacement.size() - 1).setVersionToInstant(now.plus(90, SECONDS));

      _cfgMaster.replaceAllVersions(latestDoc, replacement);
View Full Code Here

Examples of org.threeten.bp.LocalDate.minus()

    if (fromEnd) {
      LocalDate date = endDate;
      int i = 1;
      while (!date.isBefore(startDate)) {
        dates.add(date);
        date = generateRecursive ? date.minus(Period.ofYears(1)) : endDate.minus(Period.ofYears(i++));
      }
      Collections.reverse(dates);
      return dates.toArray(EMPTY_LOCAL_DATE_ARRAY);
    }
    LocalDate date = startDate;
View Full Code Here

Examples of org.threeten.bp.Period.minus()

      if (o instanceof PlusMinusPeriodDateConstraint) {
        final PlusMinusPeriodDateConstraint other = (PlusMinusPeriodDateConstraint) o;
        if (ObjectUtils.equals(_underlying, other._underlying)) {
          final Period a = _plus ? _period : _period.negated();
          final Period b = other._plus ? other._period : other._period.negated();
          return b.minus(a);
        }
      } else if (o.equals((_underlying == null) ? DateConstraint.VALUATION_TIME : _underlying)) {
        if (_plus) {
          return _period.negated();
        } else {
View Full Code Here

Examples of org.threeten.bp.ZonedDateTime.minus()

    ZonedDateTime date = maturityDate;

    // TODO review the tolerance given
    while (date.isAfter(effectiveDate) && DateUtils.getExactDaysBetween(effectiveDate, date) > 4.0) {
      dates.add(date);
      date = date.minus(period);
    }

    Collections.sort(dates);
    return dates.toArray(EMPTY_ARRAY);
  }
View Full Code Here

Examples of org.threeten.bp.chrono.ChronoLocalDate.minus()

        int lengthOfMonth = (int) date.lengthOfMonth();
        ChronoLocalDate end = date.with(ChronoField.DAY_OF_MONTH, lengthOfMonth);
        end = end.plus(7 - end.get(ChronoField.DAY_OF_WEEK), ChronoUnit.DAYS);
        // Back up to the beginning of the week including the 1st of the month
        ChronoLocalDate start = date.with(ChronoField.DAY_OF_MONTH, 1);
        start = start.minus(start.get(ChronoField.DAY_OF_WEEK), ChronoUnit.DAYS);

        out.printf("%9s Month %2d, %4d%n", date.getChronology().getId(),
                date.get(ChronoField.MONTH_OF_YEAR),
                date.get(ChronoField.YEAR));
        String[] colText = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"};
View Full Code Here

Examples of org.threeten.bp.temporal.Temporal.minus()

    final TemporalAdjuster adjuster = new TemporalAdjuster() {
      @Override
      public Temporal adjustInto(final Temporal temporal) {
        Temporal adjusted = temporal;
        do {
          adjusted = adjusted.minus(1, ChronoUnit.MONTHS);
        } while (!IMM_MONTHS.contains(Month.from(adjusted)));
        return adjusted;
      }
    };
    return date.with(adjuster);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.