Calculate interval in hours with the given interval

@param inputInterval input interval
@param extractType Extract type
@param watermarkType Watermark type
@return interval in range
975652
private static int getUpdatedInterval(int inputInterval, ExtractType extractType, WatermarkType watermarkType) {
    LOG.debug("Getting updated interval");
    if ((extractType == ExtractType.SNAPSHOT && watermarkType == WatermarkType.DATE)) {
      return inputInterval * 24;
    } else if (extractType == ExtractType.APPEND_DAILY) {
      return (inputInterval < 1 ? 1 : inputInterval) * 24;
    } else {
      return inputInterval;
    }
  }
1268814
public void addTimeInterval(T interval){
		timeIntervals.add(interval);
		minBorders.setStart(Math.max(minBorders.getStart(), interval.getStart()));
		minBorders.setEnd(Math.min(minBorders.getEnd(), interval.getEnd()));
		if(maxBorders == null){
			maxBorders = interval.clone();
		} else {
			maxBorders.setStart(Math.min(maxBorders.getStart(), interval.getStart()));
			maxBorders.setEnd(Math.max(maxBorders.getEnd(), interval.getEnd()));
		}
	}
621403
private List<TaskLockPosse> findLockPossesOverlapsInterval(final String dataSource, final Interval interval)
  {
    giant.lock();

    try {
      final NavigableMap<DateTime, SortedMap<Interval, List<TaskLockPosse>>> dsRunning = running.get(dataSource);
      if (dsRunning == null) {
        // No locks at all
        return Collections.emptyList();
      } else {
        // Tasks are indexed by locked interval, which are sorted by interval start. Intervals are non-overlapping, so:
        final NavigableSet<DateTime> dsLockbox = dsRunning.navigableKeySet();
        final Iterable<DateTime> searchStartTimes = Iterables.concat(
            // Single interval that starts at or before ours
            Collections.singletonList(dsLockbox.floor(interval.getStart())),

            // All intervals that start somewhere between our start instant (exclusive) and end instant (exclusive)
            dsLockbox.subSet(interval.getStart(), false, interval.getEnd(), false)
        );

        return StreamSupport.stream(searchStartTimes.spliterator(), false)
                            .filter(java.util.Objects::nonNull)
                            .map(dsRunning::get)
                            .filter(java.util.Objects::nonNull)
                            .flatMap(sortedMap -> sortedMap.entrySet().stream())
                            .filter(entry -> entry.getKey().overlaps(interval))
                            .flatMap(entry -> entry.getValue().stream())
                            .collect(Collectors.toList());
      }
    }
    finally {
      giant.unlock();
    }
  }
634547
public static <E extends Comparable<E>> Interval<E> toValidInterval(E a, E b) {
    return toValidInterval(a,b,0);
  }
602906
private void findSentenceIntervals(JCas jcas){
		HashSet<Timex3Interval> timexesToRemove = new HashSet<Timex3Interval>();
		
		FSIterator iterSentence = jcas.getAnnotationIndex(Sentence.type).iterator();
		while (iterSentence.hasNext()) {
			Sentence s=(Sentence)iterSentence.next();
			String sString=s.getCoveredText();
			FSIterator iterInter = jcas.getAnnotationIndex(Timex3Interval.type).subiterator(s);
			int count=0;
			List<Timex3Interval> txes=new ArrayList<Timex3Interval>();
			List<Timex3Interval> sentenceTxes=new ArrayList<Timex3Interval>();
			
			while(iterInter.hasNext()){
				Timex3Interval t=(Timex3Interval)iterInter.next();
				sString=sString.replace(t.getCoveredText(), "<TX3_"+count+">");
				count++;
				txes.add(t);
			}

			if(count>0){

				if (find_interval_candidates){
					IntervalCandidateSentence sI=new IntervalCandidateSentence(jcas);
					sI.setBegin(s.getBegin());
					sI.setEnd(s.getEnd());
					sI.addToIndexes();
				}
				for(Pattern p: hmIntervalPattern.keySet()){
					
					String name=hmIntervalPattern.get(p);
					List<MatchResult>results=(List<MatchResult>)Toolbox.findMatches(p,sString);
					if(results.size()>0){
						//Interval in Sentence s found by Pattern p!
						for(MatchResult r: results){
							Pattern pNorm=Pattern.compile("group\\(([1-9]+)\\)-group\\(([1-9]+)\\)");
							String norm=hmIntervalNormalization.get(name);
							
							Matcher mNorm=pNorm.matcher(norm);
							if(!mNorm.matches()){
								System.err.println("Problem with the Norm in rule "+name);
							}
							Timex3Interval startTx=null,endTx=null;
							try{
								int startId=Integer.parseInt(mNorm.group(1));
								int endId=Integer.parseInt(mNorm.group(2));
								
								startTx=txes.get(Integer.parseInt(r.group(startId)));
								endTx=txes.get(Integer.parseInt(r.group(endId)));
							}catch(Exception e){
								e.printStackTrace();
								return;
							}
							Timex3Interval annotation=new Timex3Interval(jcas);
							annotation.setBegin(startTx.getBegin()>endTx.getBegin()?endTx.getBegin():startTx.getBegin());
							annotation.setEnd(startTx.getEnd()>endTx.getEnd()?startTx.getEnd():endTx.getEnd());
							
							//Does the interval already exist,
							//found by another pattern?
							boolean duplicate=false;
							for(Timex3Interval tx:sentenceTxes){
								if(tx.getBegin()==annotation.getBegin() &&
										tx.getEnd()==annotation.getEnd()){
									duplicate=true;
									break;
								}
							}
							
							if(!duplicate){
								annotation.setTimexValueEB(startTx.getTimexValueEB());
								annotation.setTimexValueLB(startTx.getTimexValueLE());
								annotation.setTimexValueEE(endTx.getTimexValueEB());
								annotation.setTimexValueLE(endTx.getTimexValueLE());
								annotation.setTimexType(startTx.getTimexType());
								annotation.setFoundByRule(name);
								
								
								// create emptyvalue value
								String emptyValue = createEmptyValue(startTx, endTx, jcas);
								annotation.setEmptyValue(emptyValue);
								annotation.setBeginTimex(startTx.getBeginTimex());
								annotation.setEndTimex(endTx.getEndTimex());
								
								try {
									sentenceTxes.add(annotation);
								} catch(NumberFormatException e) {
									Logger.printError(component, "Couldn't do emptyValue calculation on accont of a faulty normalization in " 
											+ annotation.getTimexValueEB() + " or " + annotation.getTimexValueEE());
								}
								
								// prepare tx3intervals to remove
								timexesToRemove.add(startTx);
								timexesToRemove.add(endTx);
								
								annotation.addToIndexes();
//								System.out.println(emptyValue);
							}
						}
					}
				}
			}
		}
		
		for(Timex3Interval txi : timexesToRemove) {
			txi.removeFromIndexes();
		}
	}
1241627
ReadIteratorResource<Read, ReadGroupSet, Reference> queryNextInterval() {
    Stopwatch w = Stopwatch.createStarted();
    if (!isAtEnd()) {
      intervalIndex++;
    }
    if (isAtEnd()) {
      return null;
    }
    ReadIteratorResource<Read, ReadGroupSet, Reference> result =  
        queryForInterval(currentInterval());
    LOG.info("Interval query took: " + w);
    startTiming();
    return result;
  }
416475
private static Integer getMinuteUtc(AisExtractor extractor,
			int slotTimeout, int startIndex) {
		if (slotTimeout == 1) {
			// skip the msb bit
			int minutes = extractor.getValue(startIndex + 10, startIndex + 17);
			return minutes;
		} else
			return null;
	}
909976
public static long getNextIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
		long interval = MINUTE_IN_MS * intervalInMinutes;
		return getPreviousIntervalStart(time, intervalInMinutes, offsetInMinutes) + interval;
	}
1322529
private static Integer getHourUtc(AisExtractor extractor, int slotTimeout,
			int startIndex) {
		if (slotTimeout == 1) {
			// skip the msb bit
			int hours = extractor.getValue(startIndex + 5, startIndex + 10);
			return hours;
		} else
			return null;
	}
841893
public SleepBuilder<T> withInterval(long interval, TimeUnit timeUnit) {
        this.interval = timeUnit.toMillis(interval);
        return this;
    }
831216
public BaseWindowedBolt withWatermarkInterval(Duration interval) {
    if (interval == null) {
      throw new IllegalArgumentException("Watermark interval cannot be set null");
    }
    if (interval.isNegative() || interval.isZero()) {
      throw new IllegalArgumentException("Watermark interval must be positive [" + interval + "]");
    }
    windowConfiguration.put(WindowingConfigs.TOPOLOGY_BOLTS_WATERMARK_EVENT_INTERVAL_MS,
        interval.toMillis());
    return this;
  }
1176140
private static AppendMaxLimitType getAppendLimitType(ExtractType extractType, String maxLimit) {
    LOG.debug("Getting append limit type");
    AppendMaxLimitType limitType;
    switch (extractType) {
      case APPEND_DAILY:
        limitType = AppendMaxLimitType.CURRENTDATE;
        break;
      case APPEND_HOURLY:
        limitType = AppendMaxLimitType.CURRENTHOUR;
        break;
      default:
        limitType = null;
        break;
    }

    if (!Strings.isNullOrEmpty(maxLimit)) {
      LOG.debug("Getting append limit type from the config");
      String[] limitParams = maxLimit.split("-");
      if (limitParams.length >= 1) {
        limitType = AppendMaxLimitType.valueOf(limitParams[0]);
      }
    }
    return limitType;
  }
1066011
@Override
    ChronoInterval<PlainTime> newInterval(
        Boundary<PlainTime> start,
        Boundary<PlainTime> end
    ) {

        return ClockIntervalFactory.INSTANCE.between(start, end);

    }
1116568
public static long getPreviousIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
		long interval = MINUTE_IN_MS * intervalInMinutes;
		long offset = calculateOffsetInMs(intervalInMinutes, offsetInMinutes);
		
		return (interval * ((time + LOCAL_UTC_OFFSET - offset) / (interval))) + offset - LOCAL_UTC_OFFSET;
	}
516594
public final void mTIME_INTERVAL() throws RecognitionException {
		try {
			int _type = TIME_INTERVAL;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:5: ( ( ( '0' .. '9' )+ 'd' ) ( ( '0' .. '9' )+ 'h' )? ( ( '0' .. '9' )+ 'm' )? ( ( '0' .. '9' )+ 's' )? ( ( '0' .. '9' )+ ( 'ms' )? )? | ( ( '0' .. '9' )+ 'h' ) ( ( '0' .. '9' )+ 'm' )? ( ( '0' .. '9' )+ 's' )? ( ( '0' .. '9' )+ ( 'ms' )? )? | ( ( '0' .. '9' )+ 'm' ) ( ( '0' .. '9' )+ 's' )? ( ( '0' .. '9' )+ ( 'ms' )? )? | ( ( '0' .. '9' )+ 's' ) ( ( '0' .. '9' )+ ( 'ms' )? )? | ( ( '0' .. '9' )+ ( 'ms' )? ) )
			int alt53=5;
			alt53 = dfa53.predict(input);
			switch (alt53) {
				case 1 :
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:7: ( ( '0' .. '9' )+ 'd' ) ( ( '0' .. '9' )+ 'h' )? ( ( '0' .. '9' )+ 'm' )? ( ( '0' .. '9' )+ 's' )? ( ( '0' .. '9' )+ ( 'ms' )? )?
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:7: ( ( '0' .. '9' )+ 'd' )
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:8: ( '0' .. '9' )+ 'd'
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:8: ( '0' .. '9' )+
					int cnt23=0;
					loop23:
					while (true) {
						int alt23=2;
						int LA23_0 = input.LA(1);
						if ( ((LA23_0 >= '0' && LA23_0 <= '9')) ) {
							alt23=1;
						}

						switch (alt23) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
							{
							if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
								input.consume();
								state.failed=false;
							}
							else {
								if (state.backtracking>0) {state.failed=true; return;}
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

						default :
							if ( cnt23 >= 1 ) break loop23;
							if (state.backtracking>0) {state.failed=true; return;}
							EarlyExitException eee = new EarlyExitException(23, input);
							throw eee;
						}
						cnt23++;
					}

					match('d'); if (state.failed) return;
					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:25: ( ( '0' .. '9' )+ 'h' )?
					int alt25=2;
					alt25 = dfa25.predict(input);
					switch (alt25) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:26: ( '0' .. '9' )+ 'h'
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:26: ( '0' .. '9' )+
							int cnt24=0;
							loop24:
							while (true) {
								int alt24=2;
								int LA24_0 = input.LA(1);
								if ( ((LA24_0 >= '0' && LA24_0 <= '9')) ) {
									alt24=1;
								}

								switch (alt24) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt24 >= 1 ) break loop24;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(24, input);
									throw eee;
								}
								cnt24++;
							}

							match('h'); if (state.failed) return;
							}
							break;

					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:43: ( ( '0' .. '9' )+ 'm' )?
					int alt27=2;
					alt27 = dfa27.predict(input);
					switch (alt27) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:44: ( '0' .. '9' )+ 'm'
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:44: ( '0' .. '9' )+
							int cnt26=0;
							loop26:
							while (true) {
								int alt26=2;
								int LA26_0 = input.LA(1);
								if ( ((LA26_0 >= '0' && LA26_0 <= '9')) ) {
									alt26=1;
								}

								switch (alt26) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt26 >= 1 ) break loop26;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(26, input);
									throw eee;
								}
								cnt26++;
							}

							match('m'); if (state.failed) return;
							}
							break;

					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:61: ( ( '0' .. '9' )+ 's' )?
					int alt29=2;
					alt29 = dfa29.predict(input);
					switch (alt29) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:62: ( '0' .. '9' )+ 's'
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:62: ( '0' .. '9' )+
							int cnt28=0;
							loop28:
							while (true) {
								int alt28=2;
								int LA28_0 = input.LA(1);
								if ( ((LA28_0 >= '0' && LA28_0 <= '9')) ) {
									alt28=1;
								}

								switch (alt28) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt28 >= 1 ) break loop28;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(28, input);
									throw eee;
								}
								cnt28++;
							}

							match('s'); if (state.failed) return;
							}
							break;

					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:79: ( ( '0' .. '9' )+ ( 'ms' )? )?
					int alt32=2;
					int LA32_0 = input.LA(1);
					if ( ((LA32_0 >= '0' && LA32_0 <= '9')) ) {
						alt32=1;
					}
					switch (alt32) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:80: ( '0' .. '9' )+ ( 'ms' )?
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:80: ( '0' .. '9' )+
							int cnt30=0;
							loop30:
							while (true) {
								int alt30=2;
								int LA30_0 = input.LA(1);
								if ( ((LA30_0 >= '0' && LA30_0 <= '9')) ) {
									alt30=1;
								}

								switch (alt30) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt30 >= 1 ) break loop30;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(30, input);
									throw eee;
								}
								cnt30++;
							}

							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:92: ( 'ms' )?
							int alt31=2;
							int LA31_0 = input.LA(1);
							if ( (LA31_0=='m') ) {
								alt31=1;
							}
							switch (alt31) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:114:92: 'ms'
									{
									match("ms"); if (state.failed) return;

									}
									break;

							}

							}
							break;

					}

					}
					break;
				case 2 :
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:7: ( ( '0' .. '9' )+ 'h' ) ( ( '0' .. '9' )+ 'm' )? ( ( '0' .. '9' )+ 's' )? ( ( '0' .. '9' )+ ( 'ms' )? )?
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:7: ( ( '0' .. '9' )+ 'h' )
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:8: ( '0' .. '9' )+ 'h'
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:8: ( '0' .. '9' )+
					int cnt33=0;
					loop33:
					while (true) {
						int alt33=2;
						int LA33_0 = input.LA(1);
						if ( ((LA33_0 >= '0' && LA33_0 <= '9')) ) {
							alt33=1;
						}

						switch (alt33) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
							{
							if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
								input.consume();
								state.failed=false;
							}
							else {
								if (state.backtracking>0) {state.failed=true; return;}
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

						default :
							if ( cnt33 >= 1 ) break loop33;
							if (state.backtracking>0) {state.failed=true; return;}
							EarlyExitException eee = new EarlyExitException(33, input);
							throw eee;
						}
						cnt33++;
					}

					match('h'); if (state.failed) return;
					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:25: ( ( '0' .. '9' )+ 'm' )?
					int alt35=2;
					alt35 = dfa35.predict(input);
					switch (alt35) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:26: ( '0' .. '9' )+ 'm'
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:26: ( '0' .. '9' )+
							int cnt34=0;
							loop34:
							while (true) {
								int alt34=2;
								int LA34_0 = input.LA(1);
								if ( ((LA34_0 >= '0' && LA34_0 <= '9')) ) {
									alt34=1;
								}

								switch (alt34) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt34 >= 1 ) break loop34;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(34, input);
									throw eee;
								}
								cnt34++;
							}

							match('m'); if (state.failed) return;
							}
							break;

					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:43: ( ( '0' .. '9' )+ 's' )?
					int alt37=2;
					alt37 = dfa37.predict(input);
					switch (alt37) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:44: ( '0' .. '9' )+ 's'
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:44: ( '0' .. '9' )+
							int cnt36=0;
							loop36:
							while (true) {
								int alt36=2;
								int LA36_0 = input.LA(1);
								if ( ((LA36_0 >= '0' && LA36_0 <= '9')) ) {
									alt36=1;
								}

								switch (alt36) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt36 >= 1 ) break loop36;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(36, input);
									throw eee;
								}
								cnt36++;
							}

							match('s'); if (state.failed) return;
							}
							break;

					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:61: ( ( '0' .. '9' )+ ( 'ms' )? )?
					int alt40=2;
					int LA40_0 = input.LA(1);
					if ( ((LA40_0 >= '0' && LA40_0 <= '9')) ) {
						alt40=1;
					}
					switch (alt40) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:62: ( '0' .. '9' )+ ( 'ms' )?
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:62: ( '0' .. '9' )+
							int cnt38=0;
							loop38:
							while (true) {
								int alt38=2;
								int LA38_0 = input.LA(1);
								if ( ((LA38_0 >= '0' && LA38_0 <= '9')) ) {
									alt38=1;
								}

								switch (alt38) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt38 >= 1 ) break loop38;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(38, input);
									throw eee;
								}
								cnt38++;
							}

							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:74: ( 'ms' )?
							int alt39=2;
							int LA39_0 = input.LA(1);
							if ( (LA39_0=='m') ) {
								alt39=1;
							}
							switch (alt39) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:115:74: 'ms'
									{
									match("ms"); if (state.failed) return;

									}
									break;

							}

							}
							break;

					}

					}
					break;
				case 3 :
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:7: ( ( '0' .. '9' )+ 'm' ) ( ( '0' .. '9' )+ 's' )? ( ( '0' .. '9' )+ ( 'ms' )? )?
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:7: ( ( '0' .. '9' )+ 'm' )
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:8: ( '0' .. '9' )+ 'm'
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:8: ( '0' .. '9' )+
					int cnt41=0;
					loop41:
					while (true) {
						int alt41=2;
						int LA41_0 = input.LA(1);
						if ( ((LA41_0 >= '0' && LA41_0 <= '9')) ) {
							alt41=1;
						}

						switch (alt41) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
							{
							if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
								input.consume();
								state.failed=false;
							}
							else {
								if (state.backtracking>0) {state.failed=true; return;}
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

						default :
							if ( cnt41 >= 1 ) break loop41;
							if (state.backtracking>0) {state.failed=true; return;}
							EarlyExitException eee = new EarlyExitException(41, input);
							throw eee;
						}
						cnt41++;
					}

					match('m'); if (state.failed) return;
					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:25: ( ( '0' .. '9' )+ 's' )?
					int alt43=2;
					alt43 = dfa43.predict(input);
					switch (alt43) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:26: ( '0' .. '9' )+ 's'
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:26: ( '0' .. '9' )+
							int cnt42=0;
							loop42:
							while (true) {
								int alt42=2;
								int LA42_0 = input.LA(1);
								if ( ((LA42_0 >= '0' && LA42_0 <= '9')) ) {
									alt42=1;
								}

								switch (alt42) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt42 >= 1 ) break loop42;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(42, input);
									throw eee;
								}
								cnt42++;
							}

							match('s'); if (state.failed) return;
							}
							break;

					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:43: ( ( '0' .. '9' )+ ( 'ms' )? )?
					int alt46=2;
					int LA46_0 = input.LA(1);
					if ( ((LA46_0 >= '0' && LA46_0 <= '9')) ) {
						alt46=1;
					}
					switch (alt46) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:44: ( '0' .. '9' )+ ( 'ms' )?
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:44: ( '0' .. '9' )+
							int cnt44=0;
							loop44:
							while (true) {
								int alt44=2;
								int LA44_0 = input.LA(1);
								if ( ((LA44_0 >= '0' && LA44_0 <= '9')) ) {
									alt44=1;
								}

								switch (alt44) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt44 >= 1 ) break loop44;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(44, input);
									throw eee;
								}
								cnt44++;
							}

							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:56: ( 'ms' )?
							int alt45=2;
							int LA45_0 = input.LA(1);
							if ( (LA45_0=='m') ) {
								alt45=1;
							}
							switch (alt45) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:116:56: 'ms'
									{
									match("ms"); if (state.failed) return;

									}
									break;

							}

							}
							break;

					}

					}
					break;
				case 4 :
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:7: ( ( '0' .. '9' )+ 's' ) ( ( '0' .. '9' )+ ( 'ms' )? )?
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:7: ( ( '0' .. '9' )+ 's' )
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:8: ( '0' .. '9' )+ 's'
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:8: ( '0' .. '9' )+
					int cnt47=0;
					loop47:
					while (true) {
						int alt47=2;
						int LA47_0 = input.LA(1);
						if ( ((LA47_0 >= '0' && LA47_0 <= '9')) ) {
							alt47=1;
						}

						switch (alt47) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
							{
							if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
								input.consume();
								state.failed=false;
							}
							else {
								if (state.backtracking>0) {state.failed=true; return;}
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

						default :
							if ( cnt47 >= 1 ) break loop47;
							if (state.backtracking>0) {state.failed=true; return;}
							EarlyExitException eee = new EarlyExitException(47, input);
							throw eee;
						}
						cnt47++;
					}

					match('s'); if (state.failed) return;
					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:25: ( ( '0' .. '9' )+ ( 'ms' )? )?
					int alt50=2;
					int LA50_0 = input.LA(1);
					if ( ((LA50_0 >= '0' && LA50_0 <= '9')) ) {
						alt50=1;
					}
					switch (alt50) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:26: ( '0' .. '9' )+ ( 'ms' )?
							{
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:26: ( '0' .. '9' )+
							int cnt48=0;
							loop48:
							while (true) {
								int alt48=2;
								int LA48_0 = input.LA(1);
								if ( ((LA48_0 >= '0' && LA48_0 <= '9')) ) {
									alt48=1;
								}

								switch (alt48) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
									{
									if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
										input.consume();
										state.failed=false;
									}
									else {
										if (state.backtracking>0) {state.failed=true; return;}
										MismatchedSetException mse = new MismatchedSetException(null,input);
										recover(mse);
										throw mse;
									}
									}
									break;

								default :
									if ( cnt48 >= 1 ) break loop48;
									if (state.backtracking>0) {state.failed=true; return;}
									EarlyExitException eee = new EarlyExitException(48, input);
									throw eee;
								}
								cnt48++;
							}

							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:38: ( 'ms' )?
							int alt49=2;
							int LA49_0 = input.LA(1);
							if ( (LA49_0=='m') ) {
								alt49=1;
							}
							switch (alt49) {
								case 1 :
									// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:117:38: 'ms'
									{
									match("ms"); if (state.failed) return;

									}
									break;

							}

							}
							break;

					}

					}
					break;
				case 5 :
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:118:7: ( ( '0' .. '9' )+ ( 'ms' )? )
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:118:7: ( ( '0' .. '9' )+ ( 'ms' )? )
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:118:8: ( '0' .. '9' )+ ( 'ms' )?
					{
					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:118:8: ( '0' .. '9' )+
					int cnt51=0;
					loop51:
					while (true) {
						int alt51=2;
						int LA51_0 = input.LA(1);
						if ( ((LA51_0 >= '0' && LA51_0 <= '9')) ) {
							alt51=1;
						}

						switch (alt51) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:
							{
							if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
								input.consume();
								state.failed=false;
							}
							else {
								if (state.backtracking>0) {state.failed=true; return;}
								MismatchedSetException mse = new MismatchedSetException(null,input);
								recover(mse);
								throw mse;
							}
							}
							break;

						default :
							if ( cnt51 >= 1 ) break loop51;
							if (state.backtracking>0) {state.failed=true; return;}
							EarlyExitException eee = new EarlyExitException(51, input);
							throw eee;
						}
						cnt51++;
					}

					// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:118:20: ( 'ms' )?
					int alt52=2;
					int LA52_0 = input.LA(1);
					if ( (LA52_0=='m') ) {
						alt52=1;
					}
					switch (alt52) {
						case 1 :
							// src/main/resources/org/drools/compiler/lang/DRL5Lexer.g:118:20: 'ms'
							{
							match("ms"); if (state.failed) return;

							}
							break;

					}

					}

					}
					break;

			}
			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
979584
function _calculateIntervals() {

		var oStartDate = this.getStartDate();
		var oEndDate;
		var iIntervals = this.getIntervals();
		var sIntervalType = this.getIntervalType();

		this._oUTCStartDate = _calculateStartDate.call(this, oStartDate);

		switch (sIntervalType) {
		case CalendarIntervalType.Hour:
			oEndDate = new UniversalDate(this._oUTCStartDate.getTime());
			oEndDate.setUTCHours(oEndDate.getUTCHours() + iIntervals);
			this._iMinDelta = this._iHoursMinDelta;
			break;

		case CalendarIntervalType.Day:
		case CalendarIntervalType.Week:
		case CalendarIntervalType.OneMonth:
			oEndDate = new UniversalDate(this._oUTCStartDate.getTime());
			oEndDate.setUTCDate(oEndDate.getUTCDate() + iIntervals);
			this._iMinDelta = this._iDaysMinDelta;
			break;

		case CalendarIntervalType.Month:
			oEndDate = new UniversalDate(this._oUTCStartDate.getTime());
			oEndDate.setUTCMonth(oEndDate.getUTCMonth() + iIntervals);
			this._iMinDelta = this._iMonthsMinDelta;
			break;

		default:
			throw new Error("Unknown IntervalType: " + sIntervalType + "; " + this);
		}

		oEndDate.setUTCMilliseconds(-1);
		this._iRowSize = oEndDate.getTime() - this._oUTCStartDate.getTime();
		this._iIntervalSize = Math.floor(this._iRowSize / iIntervals);
		this._oUTCEndDate = oEndDate;

	}
423832
public static boolean isWithinMinuteOfIntervalStart(long time, int intervalInMinutes, int offsetInMinutes) {
	
		time += LOCAL_UTC_OFFSET;
		long interval = MINUTE_IN_MS * intervalInMinutes;
		long offset = calculateOffsetInMs(intervalInMinutes, offsetInMinutes);
	
		return (interval * ((time + HALF_MINUTE_IN_MS) / interval)) + offset
				== roundToMinute(time);
	}