Package com.projity.pm.time

Examples of com.projity.pm.time.HasStartAndEnd


    if (mustExecuteChild) {
      child.reset();
      child.execute(object);
    }

    HasStartAndEnd interval = (HasStartAndEnd)object;
   
    calculatedValues.set(generator == null ? 0 : generator.getIndex(),
        interval.getStart(),
        interval.getEnd(),
        ((DoubleValue)child).getValue(),
        child.getWorkCalendar());
  }
View Full Code Here


  /**
   * Add buckets to the collection.  The new interval has priority over the existing contour.  Buckets
   * are re-used if they are identical.
   */
  public void execute(Object object) {
    HasStartAndEnd interval = (HasStartAndEnd)object;
    AbstractContourBucket bucket = (AbstractContourBucket) contourBucketIntervalGenerator.current();
    if (bucket == null)
      return;
    if (bucket instanceof PersonalContourBucket)
      list.add(bucket);
View Full Code Here

            List currentIntervals=current.getWorkingHours().getIntervals();
            List commonIntervals=common.getWorkingHours().getIntervals();
            if (commonIntervals.size()!=currentIntervals.size()) return null;
            Iterator com=commonIntervals.iterator();
            Iterator cur=currentIntervals.iterator();
            HasStartAndEnd comInterval,curInterval;
            while (com.hasNext()){
                comInterval=(HasStartAndEnd)com.next();
                curInterval=(HasStartAndEnd)cur.next();
                if (curInterval==null&&comInterval==null) continue;
                if (curInterval==null&&comInterval!=null) return null;
                if (curInterval!=null&&comInterval==null) return null;
                if (comInterval.getStart()!=curInterval.getStart()||comInterval.getEnd()!=curInterval.getEnd())
                    return null;
            }
        }
        return common;
  }
View Full Code Here

  private ResourceAvailabilityFunctor(Resource resource) {
    super(null,resource.getEffectiveWorkCalendar(), null);
    maxUnits = resource.getMaximumUnits(); //TODO add support for contoured availability
  }
  public void execute(Object object) {
    HasStartAndEnd interval = (HasStartAndEnd)object;
    value += maxUnits * workCalendar.compare(interval.getEnd(),interval.getStart(), false);
  }
View Full Code Here

    timephasedDataType.setType(this.type);
    timephasedDataType.setUID(this.id);
//    System.out.println("Id is " + id);

    timephasedDataType.setUnit(BigInteger.valueOf(3L));
    HasStartAndEnd interval = (HasStartAndEnd)arg0;
    Calendar startCal = DateTime.calendarInstance();
    startCal.setTimeInMillis(DateTime.fromGmt(interval.getStart())); // for 2007, convert from gmt
    Calendar endCal = DateTime.calendarInstance();
    endCal.setTimeInMillis(DateTime.fromGmt(interval.getEnd())); // for 2007, convert from gmt
    timephasedDataType.setStart(startCal);
    timephasedDataType.setFinish(endCal);
    double v = functor.getValue() / WorkCalendar.MILLIS_IN_HOUR;
    net.sf.mpxj.Duration d = net.sf.mpxj.Duration.getInstance(v,TimeUnit.HOURS);
    XsdDuration xsdDuration = new XsdDuration(d);
View Full Code Here

  static final long serialVersionUID = 7866653353331L;
    private IntervalConsumer consumer;
    private Schedule schedule;
    private long count;
    public void execute(Object arg0) {
      HasStartAndEnd interval = (HasStartAndEnd)arg0;
      long start = interval.getStart();
      if (schedule instanceof ScheduleWindow && start == schedule.getResume() && ((ScheduleWindow)schedule).getSplitDuration() == 0)
        start = schedule.getStop(); // special case
      count++;
      ScheduleInterval scheduleInterval = new ScheduleInterval(start,interval.getEnd()).intersectWith(bounds);
      if (scheduleInterval.isValid()) // bounds may make it so nothing should be drawn because end < start;
        consumer.consumeInterval(scheduleInterval);
    }
View Full Code Here

  /* (non-Javadoc)
   * @see org.apache.commons.collections.Predicate#evaluate(java.lang.Object)
   */
  public boolean evaluate(Object arg0) {
    HasStartAndEnd interval = (HasStartAndEnd)arg0;
//    boolean x = (interval.getStart() >= start && interval.getEnd() <= end);
//    System.out.println("where " + x + "range: "
//        + new java.util.Date(start) + "-"
//        + new java.util.Date(end) + "  interval "
//        + new java.util.Date(interval.getStart()) + "-"
//        + new java.util.Date(interval.getEnd()));
    return (interval.getStart() >= start && interval.getEnd() <= end);
  }
View Full Code Here

    AssignmentDurationSummer(WorkCalendar workCalendar) {
      this.workCalendar =workCalendar;
      sum = 0;
    }
    public void execute(Object arg0) {
      HasStartAndEnd interval = (HasStartAndEnd)arg0;
      sum += workCalendar.compare(interval.getEnd(), interval.getStart(),false);
    }
View Full Code Here

             timeEnd[i].setText(""); //$NON-NLS-1$
           }
      }

      if (hours!=null){
            HasStartAndEnd interval;
        //    int j=0;
            int intervals = hours.getIntervals().size();
            for (int j = 0; j < Settings.CALENDAR_INTERVALS; j++) {
//            for (Iterator i=hours.getIntervals().iterator();i.hasNext();j++){
                interval=(HasStartAndEnd)hours.getInterval(j);
//        i.next();
                if (interval!=null){
                    String startS=formatTime(interval.getStart());
                    timeStart[j].setText(startS);
                    timeEnd[j].setText(formatTime(interval.getEnd()));
                } else {
                  timeStart[j].setText(""); //$NON-NLS-1$
                  timeEnd[j].setText(""); //$NON-NLS-1$
                }
            }
View Full Code Here

   *
   */
  public Intervals(ContribIntervals c) {
    super(new Comparator(){
      public int compare(Object o1, Object o2) {
        HasStartAndEnd d1=(HasStartAndEnd)o1; //Only want to compare DateSpan no need to use instanceof
        HasStartAndEnd d2=(HasStartAndEnd)o2;
        if (d1.getStart()<d2.getStart()||(d1.getStart()==d2.getStart()&&d1.getEnd()<d2.getEnd())) return -1;
        else if (d1.getStart()>d2.getStart()||(d1.getStart()==d2.getStart()&&d1.getEnd()>d2.getEnd())) return 1;
        else return 0;
      }
    });
    if (c!=null)
      for (Iterator i=c.iterator();i.hasNext();){
View Full Code Here

TOP

Related Classes of com.projity.pm.time.HasStartAndEnd

Copyright © 2018 www.massapicom. 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.