Package com.projity.pm.time

Examples of com.projity.pm.time.HasStartAndEnd


    return new CalendarInterval(Math.min(i1.getStart(),i2.getStart()),Math.max(i1.getEnd(),i2.getEnd()));
  }


  public boolean add(Object o) {
    HasStartAndEnd toAdd=(HasStartAndEnd)o;
    SortedSet set=headSet(o);
    if (set.size()>0){
      HasStartAndEnd interval=(HasStartAndEnd)set.last();
      if (interval.getEnd()>=toAdd.getStart())
        toAdd=mergeIntervals(toAdd,interval);
    }

    set=tailSet(o);
    if (set.size()>0){
      HasStartAndEnd interval=(HasStartAndEnd)set.first();
      if (toAdd.getEnd()>=interval.getStart())
        toAdd=mergeIntervals(toAdd,interval);
    }
    return super.add(toAdd);
  }
View Full Code Here


    return (size()==0)?-1:((HasStartAndEnd)first()).getStart();
  }

  public boolean containsDate(long date){
    for (Iterator i=iterator();i.hasNext();){ //a more optimized version can be found
      HasStartAndEnd interval=(HasStartAndEnd)i.next();
      if (interval.getStart()<=date&&date<=interval.getEnd()) return true;
    }
    return false;
  }
View Full Code Here

  }

  void eliminateWeekdayDuplicates(boolean weekDays[]) {
    Calendar cal = DateTime.calendarInstance();
    for (Iterator i=iterator();i.hasNext();){ //a more optimized version can be found
      HasStartAndEnd interval=(HasStartAndEnd)i.next();
      cal.setTimeInMillis(interval.getStart());
      int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK) -1;

      // remove any days which correspond to a selected week day
      for (int d = 0; d < 7; d++) {
        if (weekDays[d] && d == dayOfWeek) {
View Full Code Here

  public void scrollToTask() {
    List impls=spreadSheet.getSelectedNodesImpl();
    if (impls.size()==0) return;
    Object impl=impls.get(0);
    if (!(impl instanceof HasStartAndEnd)) return;
    HasStartAndEnd interval=(HasStartAndEnd)impl;
    gantt.scrollToTask(interval, false);
  }
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.