internal
SweepPruneBehavior#updateIntervals()

Update position intervals on each axis
543482
function(){

            var tr
                ,intr
                ,aabb
                ,list = this.tracked
                ,i = list.length
                ;

            // for all tracked bodies
            while ( (--i) >= 0 ){

                tr = list[ i ];
                intr = tr.interval;
                aabb = tr.body.aabb();

                // copy the position (plus or minus) the aabb half-dimensions
                // into the min/max intervals
                intr.min.val.clone( aabb ).sub( aabb.hw, aabb.hh );
                intr.max.val.clone( aabb ).add( aabb.hw, aabb.hh );
            }
        }
441904
public void resetInterval(Localizable localizable)
    {
        final int intervalHorizontalOld = intervalHorizontal;
        final int intervalVerticalOld = intervalVertical;
        final double oldX = getX();
        final double oldY = getY();

        setIntervals(0, 0);
        offset.setLocation(0.0, 0.0);
        setLocation(localizable.getX(), localizable.getY());

        final double newX = getX();
        final double newY = getY();

        moveLocation(1.0, oldX - newX, oldY - newY);
        moveLocation(1.0, newX - oldX, newY - oldY);

        setIntervals(intervalHorizontalOld, intervalVerticalOld);
        offset.setLocation(0.0, 0.0);
    }
98286
function _rescheduleIntervals(now) {
    for (var i = 0; i < timeouts.length; i++) {
      var timeout = timeouts[i];
      if (timeout.type === TYPE.INTERVAL) {
        _rescheduleInterval(timeout, now);
      }
    }
  }
1010953
private void findIntervals(JCas jcas) {
		ArrayList<Timex3Interval> newAnnotations = new ArrayList<Timex3Interval>();
		
		FSIterator iterTimex3 = jcas.getAnnotationIndex(Timex3.type).iterator();
		while (iterTimex3.hasNext()) {
			Timex3Interval annotation=new Timex3Interval(jcas);
			Timex3 timex3 = (Timex3) iterTimex3.next();
			
			//DATE Pattern
			Pattern pDate = Pattern.compile("(?:BC)?(\\d\\d\\d\\d)(-(\\d+))?(-(\\d+))?(T(\\d+))?(:(\\d+))?(:(\\d+))?");
			Pattern pCentury = Pattern.compile("(\\d\\d)");
			Pattern pDecate = Pattern.compile("(\\d\\d\\d)");
			Pattern pQuarter = Pattern.compile("(\\d+)-Q([1-4])");
			Pattern pHalf = Pattern.compile("(\\d+)-H([1-2])");
			Pattern pSeason = Pattern.compile("(\\d+)-(SP|SU|FA|WI)");
			Pattern pWeek = Pattern.compile("(\\d+)-W(\\d+)");
			Pattern pWeekend = Pattern.compile("(\\d+)-W(\\d+)-WE");
			Pattern pTimeOfDay = Pattern.compile("(\\d+)-(\\d+)-(\\d+)T(AF|DT|MI|MO|EV|NI)");
			
			Matcher mDate   = pDate.matcher(timex3.getTimexValue());
			Matcher mCentury= pCentury.matcher(timex3.getTimexValue());
			Matcher mDecade = pDecate.matcher(timex3.getTimexValue());
			Matcher mQuarter= pQuarter.matcher(timex3.getTimexValue());
			Matcher mHalf   = pHalf.matcher(timex3.getTimexValue());
			Matcher mSeason = pSeason.matcher(timex3.getTimexValue());
			Matcher mWeek   = pWeek.matcher(timex3.getTimexValue());
			Matcher mWeekend= pWeekend.matcher(timex3.getTimexValue());
			Matcher mTimeOfDay= pTimeOfDay.matcher(timex3.getTimexValue());
			
			boolean matchesDate=mDate.matches();
			boolean matchesCentury=mCentury.matches();
			boolean matchesDecade=mDecade.matches();
			boolean matchesQuarter=mQuarter.matches();
			boolean matchesHalf=mHalf.matches();
			boolean matchesSeason=mSeason.matches();
			boolean matchesWeek=mWeek.matches();
			boolean matchesWeekend=mWeekend.matches();
			boolean matchesTimeOfDay=mTimeOfDay.matches();
			
			String beginYear, endYear;
			String beginMonth, endMonth;
			String beginDay, endDay;
			String beginHour, endHour;
			String beginMinute, endMinute;
			String beginSecond, endSecond;

			beginYear=endYear="UNDEF";
			beginMonth="01";
			endMonth="12";
			beginDay="01";
			endDay="31";
			beginHour="00";
			endHour="23";
			beginMinute="00";
			endMinute="59";
			beginSecond="00";
			endSecond="59";
			
			if(matchesDate){
				
				//Get Year(1)
				beginYear=endYear=mDate.group(1);
				
				//Get Month(3)
				if(mDate.group(3)!=null){
					beginMonth=endMonth=mDate.group(3);
					
					//Get Day(5)
					if(mDate.group(5)==null){
						Calendar c=Calendar.getInstance();
						c.set(Integer.parseInt(beginYear), Integer.parseInt(beginMonth)-1, 1);
						endDay=""+c.getActualMaximum(Calendar.DAY_OF_MONTH);
						beginDay="01";
					}else{
						beginDay=endDay=mDate.group(5);
						
						//Get Hour(7)
						if(mDate.group(7)!=null){
							beginHour=endHour=mDate.group(7);

							//Get Minute(9)
							if(mDate.group(9)!=null){
								beginMinute=endMinute=mDate.group(9);

								//Get Second(11)
								if(mDate.group(11)!=null){
									beginSecond=endSecond=mDate.group(11);
								}
							}
						}
						
					}
				}
				
			}else if(matchesCentury){
				beginYear=mCentury.group(1)+"00";
				endYear=mCentury.group(1)+"99";
			}else if(matchesDecade){
				beginYear=mDecade.group(1)+"0";
				endYear=mDecade.group(1)+"9";
			}else if(matchesQuarter){
				beginYear=endYear=mQuarter.group(1);
				int beginMonthI=3*(Integer.parseInt(mQuarter.group(2))-1)+1;
				beginMonth=""+beginMonthI;
				endMonth=""+(beginMonthI+2);
				Calendar c=Calendar.getInstance();
				c.set(Integer.parseInt(beginYear), Integer.parseInt(endMonth)-1, 1);
				endDay=""+c.getActualMaximum(Calendar.DAY_OF_MONTH);
			}else if(matchesHalf){
				beginYear=endYear=mHalf.group(1);
				int beginMonthI=6*(Integer.parseInt(mHalf.group(2))-1)+1;
				beginMonth=""+beginMonthI;
				endMonth=""+(beginMonthI+5);
				Calendar c=Calendar.getInstance();
				c.set(Integer.parseInt(beginYear), Integer.parseInt(endMonth)-1, 1);
				endDay=""+c.getActualMaximum(Calendar.DAY_OF_MONTH);
			}else if(matchesSeason){
				beginYear=mSeason.group(1);
				endYear=beginYear;
				if(mSeason.group(2).equals("SP")){
					beginMonth="03";
					beginDay="21";
					endMonth="06";
					endDay="20";
				}else if(mSeason.group(2).equals("SU")){
					beginMonth="06";
					beginDay="21";
					endMonth="09";
					endDay="22";
				}else if(mSeason.group(2).equals("FA")){
					beginMonth="09";
					beginDay="23";
					endMonth="12";
					endDay="21";
				}else if(mSeason.group(2).equals("WI")){
					endYear=""+(Integer.parseInt(beginYear)+1);
					beginMonth="12";
					beginDay="22";
					endMonth="03";
					endDay="20";
				}
			}else if(matchesWeek){
				beginYear=endYear=mWeek.group(1);
				Calendar c=Calendar.getInstance();
				c.setFirstDayOfWeek(Calendar.MONDAY);
				c.set(Calendar.YEAR,Integer.parseInt(beginYear));
				c.set(Calendar.WEEK_OF_YEAR, Integer.parseInt(mWeek.group(2)));
				c.set(Calendar.DAY_OF_WEEK, Calendar.MONDAY);
				beginDay=""+c.get(Calendar.DAY_OF_MONTH);
				beginMonth=""+(c.get(Calendar.MONTH)+1);
				c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
				endDay=""+(c.get(Calendar.DAY_OF_MONTH));
				endMonth=""+(c.get(Calendar.MONTH)+1);
			}else if(matchesWeekend){
				beginYear=endYear=mWeekend.group(1);
				Calendar c=Calendar.getInstance();
				c.setFirstDayOfWeek(Calendar.MONDAY);
				c.set(Calendar.YEAR,Integer.parseInt(beginYear));
				c.set(Calendar.WEEK_OF_YEAR, Integer.parseInt(mWeekend.group(2)));
				c.set(Calendar.DAY_OF_WEEK, Calendar.SATURDAY);
				beginDay=""+c.get(Calendar.DAY_OF_MONTH);
				beginMonth=""+(c.get(Calendar.MONTH)+1);
				c.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
				endDay=""+(c.get(Calendar.DAY_OF_MONTH));
				endMonth=""+(c.get(Calendar.MONTH)+1);
			}else if(matchesTimeOfDay){
				beginYear=endYear=mTimeOfDay.group(1);
				beginMonth=endMonth=mTimeOfDay.group(2);
				beginDay=endDay=mTimeOfDay.group(3);
			}
			
			// correct month and days < 10
			if (Integer.parseInt(beginDay) < 10){
				beginDay = "0" + Integer.parseInt(beginDay);
			}
			if (Integer.parseInt(beginMonth) < 10){
				beginMonth = "0" + Integer.parseInt(beginMonth);
			}
			if (Integer.parseInt(endDay) < 10){
				endDay = "0" + Integer.parseInt(endDay);
			}
			if (Integer.parseInt(endMonth) < 10){
				endMonth = "0" + Integer.parseInt(endMonth);
			}
			
			if(!beginYear.equals("UNDEF") && !endYear.equals("UNDEF")){
				annotation.setTimexValueEB(beginYear+"-"+beginMonth+"-"+beginDay+"T"+beginHour+":"+beginMinute+":"+beginSecond);
//				annotation.setTimexValueLB(beginYear+"-"+beginMonth+"-"+beginDay+"T"+endHour+":"+endMinute+":"+endSecond);
//				annotation.setTimexValueEE(endYear+"-"+endMonth+"-"+endDay+"T"+beginHour+":"+beginMinute+":"+beginSecond);
				annotation.setTimexValueLE(endYear+"-"+endMonth+"-"+endDay+"T"+endHour+":"+endMinute+":"+endSecond);
				annotation.setTimexValueLB(endYear+"-"+endMonth+"-"+endDay+"T"+endHour+":"+endMinute+":"+endSecond);
				annotation.setTimexValueEE(beginYear+"-"+beginMonth+"-"+beginDay+"T"+beginHour+":"+beginMinute+":"+beginSecond);
				
				//Copy Values from the Timex3 Annotation
				annotation.setTimexFreq(timex3.getTimexFreq());
				annotation.setTimexId(timex3.getTimexId());
				annotation.setTimexInstance(timex3.getTimexInstance());
				annotation.setTimexMod(timex3.getTimexMod());
				annotation.setTimexQuant(timex3.getTimexMod());
				annotation.setTimexType(timex3.getTimexType());
				annotation.setTimexValue(timex3.getTimexValue());
				annotation.setSentId(timex3.getSentId());
				annotation.setBegin(timex3.getBegin());
				annotation.setFoundByRule(timex3.getFoundByRule());
				annotation.setEnd(timex3.getEnd());
				annotation.setAllTokIds(timex3.getAllTokIds());
				annotation.setFilename(timex3.getFilename());
				annotation.setBeginTimex(timex3.getTimexId());
				annotation.setEndTimex(timex3.getTimexId());
				
				// remember this one for addition to indexes later
				newAnnotations.add(annotation);
			}
		}
		// add to indexes
		for(Timex3Interval t3i : newAnnotations)
			t3i.addToIndexes();
	}
860912
private static void refineInterval(double[] interval, int cd, int mask) {
        if ((cd & mask) != 0)
            interval[0] = (interval[0] + interval[1]) / 2;
        else
            interval[1] = (interval[0] + interval[1]) / 2;
    }
909353
@Override
	public Envelope1D queryInterval(int semantics, int ordinate) {
		Envelope1D env = new Envelope1D();
		if (isEmptyImpl()) {
			env.setEmpty();
			return env;
		}

		_updateAllDirtyIntervals(true);
		return m_envelope.queryInterval(semantics, ordinate);
	}
1333197
public void setBackgroundInterval(long interval, TimeUnit unit)
  {
    if (! isValid()) {
      return;
    }
    
    long period = unit.toMillis(interval);
    
    if (_state == StateProfile.IDLE) {
      if (period > 0) {
        _profileTask.setPeriod(period);
        _profileTask.start();
        
        _state = StateProfile.BACKGROUND;
      }
    }
    else if (_state == StateProfile.BACKGROUND) {
      if (period <= 0) {
        _profileTask.stop();
        
        _state = StateProfile.IDLE;
      }
      else if (period != _backgroundPeriod) {
        _profileTask.stop();
        _profileTask.setPeriod(period);
        _profileTask.start();
      }
    }
    
    _backgroundPeriod = period;
  }
336777
public static boolean[] updateRanges(boolean[] range, List<RuleInterval> ruleIntervals) {
    boolean[] res = Arrays.copyOf(range, range.length);
    for (RuleInterval i : ruleIntervals) {
      int start = i.getStart();
      int end = i.getEnd();
      for (int j = start; j < end; j++) {
        res[j] = true;
      }
    }
    return res;
  }
531808
function () {

            // render the axis
            this.render();

            // move plot lines and bands
            each(this.plotLinesAndBands, function (plotLine) {
                plotLine.render();
            });

            // mark associated series as dirty and ready for redraw
            each(this.series, function (series) {
                series.isDirty = true;
            });

        }
67197
private void initializeSweepInterval(long sweepInterval)
    {
        final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
        if (isTraceOn && (tc.isEntryEnabled() || tcOOM.isEntryEnabled()))
            Tr.entry(tc.isEntryEnabled() ? tc : tcOOM,
                     "initializeSweepInterval : " + ivCache.getName() + " preferred size = " +
                                     ivPreferredMaxSize + ", sweep = " + sweepInterval);

        ivSweepInterval = sweepInterval;

        // Adjust the discard threshold according to the sweepInterval.
        // The discard threshold is a value between 2 and 20.              d112258
        if ((ivSweepInterval * ivDiscardThreshold) > MAX_THRESHOLD_MULTIPLIER)
        {
            ivDiscardThreshold = (MAX_THRESHOLD_MULTIPLIER / ivSweepInterval);
            if (ivDiscardThreshold < 2)
                ivDiscardThreshold = 2;
        }

        // Determine the upper and lower bounds for the discard threshold for
        // dynamic tuning of the eviction strategy. The max threshold will allow
        // objects to age for up to 1 minute (MAX_THRESHOLD_MULTIPLIER), and
        // the min threshold requires that objects age for at least 9 seconds
        // (MIN_THRESHOLD_MULTIPLIER).                                     d112258
        ivMaxDiscardThreshold = ivDiscardThreshold;
        ivMinDiscardThreshold = (MIN_THRESHOLD_MULTIPLIER / ivSweepInterval);
        if (ivMinDiscardThreshold < 2)
            ivMinDiscardThreshold = 2;

        if (isTraceOn && (tc.isEntryEnabled() || tcOOM.isEntryEnabled()))
            Tr.exit(tc.isEntryEnabled() ? tc : tcOOM,
                    "initializeSweepInterval : " + ivCache.getName() + " preferred size = "
                                    + ivPreferredMaxSize + ", sweep = " + ivSweepInterval +
                                    ", threshold = " + ivDiscardThreshold + ", buffer = " +
                                    ivSoftLimitBuffer);
    }
630790
function (axisModel, ecModel, api, payload, force) {
        updateAxisPointer(this, axisModel, ecModel, api, payload, false);
    }
882322
function getIntervals(ctx) {
  return ctx._intervals || (ctx._parent ? getIntervals(ctx._parent) : new Intervals());
}
1070933
private boolean containsInterval(Interval i) {
        if (i != null) {
            return directedGraph.contains(i.getStart())
                    && directedGraph.contains(i.getFinish());
        } else {
            return false;
        }
    }
1228134
@Override
    public void update(Number obj) {
        if (enable == false) {
            return;
        }

        if (intervalCheck.check()) {
            flush();
        }
        synchronized (this) {
            unflushed = updater.update(obj, unflushed);
        }
    }
984282
public T visitInterval(Interval elm, C context) {
        if (elm.getLow() != null) {
            visitElement(elm.getLow(), context);
        }
        if (elm.getLowClosedExpression() != null) {
            visitElement(elm.getLowClosedExpression(), context);
        }
        if (elm.getHigh() != null) {
            visitElement(elm.getHigh(), context);
        }
        if (elm.getHighClosedExpression() != null) {
            visitElement(elm.getHighClosedExpression(), context);
        }
        return null;
    }
1306435
static QueryInterval[] prepareQueryIntervals( final List<Interval>
			rawIntervals, final SAMSequenceDictionary sequenceDictionary ) {
		if ( rawIntervals == null || rawIntervals.isEmpty() ) {
			return null;
		}

		// Convert each SimpleInterval to a QueryInterval
		final QueryInterval[] convertedIntervals =
				rawIntervals.stream()
						.map(rawInterval -> convertSimpleIntervalToQueryInterval(rawInterval, sequenceDictionary))
						.toArray(QueryInterval[]::new);

		// Intervals must be optimized (sorted and merged) in order to use the htsjdk query API
		return QueryInterval.optimizeIntervals(convertedIntervals);
	}
995717
private void updateChildren() {
        axesPanel.setSize(getWidth(), getHeight());
        plotPanel.setSize(getWidth() - X_OFFSET_LEFT - X_OFFSET_RIGHT,
                getHeight() - Y_OFFSET_BOTTOM - Y_OFFSET_TOP);
    }