Examples of Interval


Examples of org.libreplan.business.planner.entities.StretchesFunction.Interval

        LocalDate strechDate = new LocalDate().plusDays(1);
        BigDecimal amountOfWorkProportion = BigDecimal.valueOf(0.5).setScale(2);
        givenStretchAsChild(strechDate, amountOfWorkProportion);
        givenStretchAsChild(new LocalDate().plusDays(2),
                BigDecimal.valueOf(1.0));
        Interval firstInterval = stretchesFunction
                .getIntervalsDefinedByStreches().get(1);
        assertThat(firstInterval.getEnd(), equalTo(strechDate));
        assertFalse(firstInterval.hasNoStart());
        assertThat(firstInterval.getLoadProportion(),
                equalTo(amountOfWorkProportion));
    }
View Full Code Here

Examples of org.libreplan.business.resources.entities.Interval

        Interval.range(CriterionSatisfactionDAOTest.year(1990), null);
    }

    @Test
    public void testContainsPointInTime() {
        Interval openEnded = Interval.from(CriterionSatisfactionDAOTest
                .year(1990));
        Interval range = Interval.range(
                CriterionSatisfactionDAOTest.year(1990),
                CriterionSatisfactionDAOTest.year(2000));
        Interval startPoint = Interval.point(year(1990));
        Interval endPoint = Interval.point(year(2000));
        assertTrue(openEnded.contains(CriterionSatisfactionDAOTest.year(5000)));
        assertFalse(range.contains(year(5000)));
        assertTrue(range.contains(year(1990)));
        assertFalse(range.contains(year(2000)));
        assertTrue(range.contains(year(1991)));
View Full Code Here

Examples of org.nxplanner.util.Interval

        public TimeEntryMemento(int personId1, int personId2, Date startTime, Date endTime) {
            this.personId1 = personId1;
            this.personId2 = personId2;
            if (startTime != null && endTime != null) {
                interval = new Interval(startTime.getTime(), endTime.getTime());
            } else if (startTime != null) {
                interval = new Interval(startTime.getTime());
            } else if (startTime != null) {
                interval = new Interval(endTime.getTime());
            }
        }
View Full Code Here

Examples of org.openfeed.proto.inst.Interval

   
    if(!def.getCalendar().hasLifeTime()) {
      return TimeInterval.NULL;
    }
   
    final Interval i = def.getCalendar().getLifeTime();
   
    if(i.getTimeFinish() == 0) {
      return TimeInterval.NULL;
    }
   
    return factory.newTimeInterval(i.getTimeStart(), i.getTimeFinish());
  }
View Full Code Here

Examples of org.openqreg.bean.Interval

public class TestInterval {

 
  @Test
  public void testContains() {
    Interval interval = new Interval();
   
    Calendar fromDate = Calendar.getInstance();
    fromDate.set(2007, 0, 1, 0, 0, 0);
    interval.setFromDate(fromDate);
   
    Calendar toDate = (Calendar)fromDate.clone();
    toDate.add(Calendar.MONTH, 1);
    interval.setToDate(toDate);

    // testDate == fromDate
    Calendar testDate = (Calendar)fromDate.clone();
    assertEquals("fromDate and testDate should be equal", fromDate.getTimeInMillis(), testDate.getTimeInMillis());
    assertTrue("Contains is an closed interval - fromDate is in the interval", interval.contains(testDate));

    // testDate == toDate
    testDate = (Calendar)toDate.clone();
    assertEquals("toDate and testDate should be equal", toDate.getTimeInMillis(), testDate.getTimeInMillis());
    assertTrue("Contains is an closed interval - toDate is in the interval", interval.contains(testDate));
   
    // testDate < fromDate
    testDate = (Calendar)fromDate.clone();
    testDate.add(Calendar.DAY_OF_YEAR, -1);
    assertTrue("testDate should be less then fromDate", testDate.getTimeInMillis() < fromDate.getTimeInMillis());
    assertFalse("Testdate is before startdate", interval.contains(testDate));   
   
    // testDate > toDate
    testDate = (Calendar)toDate.clone();
    testDate.add(Calendar.DAY_OF_YEAR, 1);
    assertTrue("testDate should be greater then toDate", testDate.getTimeInMillis() > toDate.getTimeInMillis());
    assertFalse("Testdate is after startdate", interval.contains(testDate));   

    // testDate inside interval
    testDate = (Calendar)fromDate.clone();
    testDate.add(Calendar.DAY_OF_YEAR, 1);
    assertTrue("testDate should be greater then fromDate", testDate.getTimeInMillis() > fromDate.getTimeInMillis());
    assertTrue("testDate should be less then fromDate", testDate.getTimeInMillis() < toDate.getTimeInMillis());
    assertTrue("testDate should be insed the interval", interval.contains(testDate));
  }
View Full Code Here

Examples of org.rabinfingerprint.datastructures.Interval

      return fingers;
    try {
      fingers = ArrayListMultimap.create();
      factory.getChunkFingerprints(stream, new ChunkVisitor() {
        public void visit(long fingerprint, long chunkStart, long chunkEnd) {
          fingers.put(fingerprint, new Interval(chunkStart, chunkEnd));
        }
      });
    } catch (IOException e) {
      throw new HandprintException("Error while computing fingerprints", e);
    }
View Full Code Here

Examples of org.timepedia.chronoscope.client.util.Interval

      drawableDataset.visDomainStartIndex = domainStartIdx;
      drawableDataset.visDomainEndIndex = domainEndIdx;

      RangeAxis rangeAxis = plot.getRangeAxis(datasetIdx);
      Interval visRange = calcVisibleRange(bestMipMap, domainStartIdx,
       domainEndIdx, drawableDataset.getRenderer());

      if (rangeAxis.isCalcRangeAsPercent()) {
        DatasetRenderer dr = plot.getDatasetRenderer(datasetIdx);
        Interval rangeExtrema = dr.getRangeExtrema(drawableDataset.currMipMap);

        double refY = calcReferenceY(rangeAxis, drawableDataset);
        double pmin = rangeExtrema.getPercentChange(refY, visRange.getStart());
        double pmax = rangeExtrema.getPercentChange(refY, visRange.getEnd());

        rangeAxis.setVisibleRange(pmin, pmax);
      }

      rangeAxis.adjustVisibleRange(
View Full Code Here

Examples of org.zkoss.ganttz.util.Interval

        List<LimitingResourceQueue> queues = loadLimitingResourceQueues();
        queuesState = new QueuesState(queues, unassigned);
        final Date startingDate = getEarliestDate();
        Date endDate = (new LocalDate(startingDate)).plusYears(2)
                .toDateTimeAtCurrentTime().toDate();
        viewInterval = new Interval(startingDate, endDate);

        Date currentDate = new Date();
        viewInterval = new Interval(
                startingDate.after(currentDate) ? currentDate : startingDate,
                endDate);

    }
View Full Code Here

Examples of timeflow.data.time.Interval

        public void adjustmentValueChanged(AdjustmentEvent e) {
          visuals.grid.setDY(bar.getValue());
         
          // set time in model.
          RoughTime startTime=visuals.grid.getFirstDrawnTime();
          Interval viewInterval=getModel().getViewInterval();
          if (viewInterval!=null)
          {
            viewInterval.translateTo(startTime.getTime());
          }
         
          calendarPanel.drawVisualization();
          calendarPanel.repaint();
        }
View Full Code Here

Examples of transientlibs.objects.primitives.Interval

        //        Log.info("Rolled gaussian: "+rolledValue);
    }

    public void addOption(int intervalSize, int setID) {
        if (intervalSize > 0) {
            rollOptions.add(new Interval(nextIndex, nextIndex + intervalSize, setID));

            nextIndex = nextIndex + intervalSize + 1;
        }
    }
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.