Package er.chronic.utils

Examples of er.chronic.utils.Span


    else {
      int direction = (pointer == Pointer.PointerType.FUTURE) ? 1 : -1;
      _currentMinuteStart.add(Calendar.MINUTE, direction);
    }
   
    return new Span(_currentMinuteStart, Calendar.SECOND, RepeaterMinute.MINUTE_SECONDS);
  }
View Full Code Here


      minuteEnd = Time.cloneAndAdd(Time.ymdhm(getNow()), Calendar.SECOND, RepeaterMinute.MINUTE_SECONDS);
    }
    else {
      throw new IllegalArgumentException("Unable to handle pointer " + pointer + ".");
    }
    return new Span(minuteBegin, minuteEnd);
  }
View Full Code Here

  protected Span _nextSpan(PointerType pointer) {
    if (_currentFortnightStart == null) {
      if (pointer == PointerType.FUTURE) {
        RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
        sundayRepeater.setStart(getNow());
        Span nextSundaySpan = sundayRepeater.nextSpan(PointerType.FUTURE);
        _currentFortnightStart = nextSundaySpan.getBeginCalendar();
      }
      else if (pointer == PointerType.PAST) {
        RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
        sundayRepeater.setStart(Time.cloneAndAdd(getNow(), Calendar.SECOND, RepeaterDay.DAY_SECONDS));
        sundayRepeater.nextSpan(PointerType.PAST);
        sundayRepeater.nextSpan(PointerType.PAST);
        Span lastSundaySpan = sundayRepeater.nextSpan(PointerType.PAST);
        _currentFortnightStart = lastSundaySpan.getBeginCalendar();
      }
      else {
        throw new IllegalArgumentException("Unable to handle pointer " + pointer + ".");
      }
    }
    else {
      int direction = (pointer == PointerType.FUTURE) ? 1 : -1;
      _currentFortnightStart.add(Calendar.SECOND, direction * RepeaterFortnight.FORTNIGHT_SECONDS);
    }

    return new Span(_currentFortnightStart, Calendar.SECOND, RepeaterFortnight.FORTNIGHT_SECONDS);
  }
View Full Code Here

  protected Span _thisSpan(PointerType pointer) {
    if (pointer == null) {
      pointer = PointerType.FUTURE;
    }

    Span span;
    if (pointer == PointerType.FUTURE) {
      Calendar thisFortnightStart = Time.cloneAndAdd(Time.ymdh(getNow()), Calendar.SECOND, RepeaterHour.HOUR_SECONDS);
      RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
      sundayRepeater.setStart(getNow());
      sundayRepeater.thisSpan(PointerType.FUTURE);
      Span thisSundaySpan = sundayRepeater.thisSpan(PointerType.FUTURE);
      Calendar thisFortnightEnd = thisSundaySpan.getBeginCalendar();
      span = new Span(thisFortnightStart, thisFortnightEnd);
    }
    else if (pointer == PointerType.PAST) {
      Calendar thisFortnightEnd = Time.ymdh(getNow());
      RepeaterDayName sundayRepeater = new RepeaterDayName(RepeaterDayName.DayName.SUNDAY);
      sundayRepeater.setStart(getNow());
      Span lastSundaySpan = sundayRepeater.nextSpan(PointerType.PAST);
      Calendar thisFortnightStart = lastSundaySpan.getBeginCalendar();
      span = new Span(thisFortnightStart, thisFortnightEnd);
    }
    else {
      throw new IllegalArgumentException("Unable to handle pointer " + pointer + ".");
    }
View Full Code Here

  }

  @Override
  public Span getOffset(Span span, float amount, PointerType pointer) {
    int direction = (pointer == PointerType.FUTURE) ? 1 : -1;
    Span offsetSpan = span.add(direction * amount * RepeaterFortnight.FORTNIGHT_SECONDS);
    return offsetSpan;
  }
View Full Code Here

    }
    else {
      int direction = (pointer == Pointer.PointerType.FUTURE) ? 1 : -1;
      _currentDayStart.add(Calendar.HOUR, direction);
    }
    return new Span(_currentDayStart, Calendar.HOUR, 1);
  }
View Full Code Here

      hourEnd = Time.cloneAndAdd(hourStart, Calendar.HOUR, 1);
    }
    else {
      throw new IllegalArgumentException("Unable to handle pointer " + pointer + ".");
    }
    return new Span(hourStart, hourEnd);
  }
View Full Code Here

    }

    int direction = (pointer == Pointer.PointerType.FUTURE) ? 1 : -1;
    _currentDayStart.add(Calendar.DAY_OF_MONTH, direction);

    return new Span(_currentDayStart, Calendar.DAY_OF_MONTH, 1);
  }
View Full Code Here

      dayEnd = Time.cloneAndAdd(Time.ymdh(getNow()), Calendar.SECOND, RepeaterDay.DAY_SECONDS);
    }
    else {
      throw new IllegalArgumentException("Unable to handle pointer " + pointer + ".");
    }
    return new Span(dayBegin, dayEnd);
  }
View Full Code Here

    }
    else {
      _secondStart.add(Calendar.SECOND, direction);
    }

    return new Span(_secondStart, Calendar.SECOND, 1);
  }
View Full Code Here

TOP

Related Classes of er.chronic.utils.Span

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.