Go to the documentation of this file.
19package org.sleuthkit.autopsy.timeline.utils;
21import java.util.ArrayList;
23import org.joda.time.DateTime;
24import org.joda.time.DateTimeZone;
25import org.joda.time.Days;
26import org.joda.time.Hours;
27import org.joda.time.Interval;
28import org.joda.time.Minutes;
29import org.joda.time.Months;
30import org.joda.time.Years;
31import org.joda.time.format.DateTimeFormatter;
32import org.sleuthkit.autopsy.timeline.zooming.TimeUnits;
88 final DateTime startWithZone =
timeRange.getStart().withZone(timeZone);
89 final DateTime endWithZone =
timeRange.getEnd().withZone(timeZone);
92 if (Years.yearsIn(
timeRange).isGreaterThan(Years.THREE)) {
94 }
else if (Months.monthsIn(
timeRange).isGreaterThan(Months.THREE)) {
96 }
else if (Days.daysIn(
timeRange).isGreaterThan(Days.THREE)) {
98 }
else if (Hours.hoursIn(
timeRange).isGreaterThan(Hours.THREE)) {
100 }
else if (Minutes.minutesIn(
timeRange).isGreaterThan(Minutes.THREE)) {
105 lower = timeUnit.
propertyOf(startWithZone).roundFloorCopy().getMillis();
106 upper = timeUnit.
propertyOf(endWithZone).roundCeilingCopy().getMillis();
135 @SuppressWarnings(
"ReturnOfCollectionOrArrayField")
138 ArrayList<Interval> intervals =
new ArrayList<>();
140 final Interval range =
new Interval(
new DateTime(
lowerBound, tz),
new DateTime(
upperBound, tz));
142 DateTime start = range.getStart();
143 while (range.contains(start)) {
146 final Interval interval =
new Interval(start, end);
147 intervals.add(interval);
final TimeUnits periodSize
synchronized List< Interval > getIntervals(DateTimeZone tz)
DateTimeFormatter getTickFormatter()
TimeUnits getPeriodSize()
static RangeDivision getRangeDivision(Interval timeRange, DateTimeZone timeZone)
RangeDivision(Interval timeRange, TimeUnits periodSize, long lowerBound, long upperBound)
Interval getOriginalTimeRange()
DateTime.Property propertyOf(DateTime dateTime)
Copyright © 2012-2024 Sleuth Kit Labs. Generated on:
This work is licensed under a
Creative Commons Attribution-Share Alike 3.0 United States License.