List of usage examples for org.joda.time Interval getEndMillis
public long getEndMillis()
From source file:io.druid.sql.calcite.filtration.RangeSets.java
License:Apache License
public static RangeSet<Long> fromIntervals(final Iterable<Interval> intervals) { final RangeSet<Long> retVal = TreeRangeSet.create(); for (Interval interval : intervals) { retVal.add(Range.closedOpen(interval.getStartMillis(), interval.getEndMillis())); }/*from w w w. j a v a 2 s .co m*/ return retVal; }
From source file:net.sf.jacclog.service.analyzer.internal.LogEntryAnalyzer.java
License:Apache License
/** * Validates a time interval if it is suitable for an analysis. * /*from w w w .j ava2 s . c o m*/ * @param interval * Time interval */ private void validateInterval(final Interval interval) { if (interval == null) { throw new IllegalArgumentException("Argument 'interval' can not be null."); } if (interval.getStart().isAfter(interval.getEndMillis())) { throw new IllegalArgumentException("The time interval specify an negative range."); } }
From source file:net.sf.jacclog.service.analyzer.internal.task.AnalysisByIntervalTask.java
License:Apache License
public AnalysisByIntervalTask( final LogEntryService<ReadableLogEntry<ReadableHttpRequestHeaderField, ReadableHttpResponseHeaderField>> service, final UserAgentStringParser parser, final LogEntryAnalysisResult.Builder builder, final Interval interval, final int startPosition, final int maxResults) { if (service == null) { throw new IllegalArgumentException("Argument 'service' can not be null."); }// www .jav a2s . c om if (parser == null) { throw new IllegalArgumentException("Argument 'parser' can not be null."); } if (builder == null) { throw new IllegalArgumentException("Argument 'builder' can not be null."); } if (interval == null) { throw new IllegalArgumentException("Argument 'interval' can not be null."); } if (interval.getStart().isAfter(interval.getEndMillis())) { throw new IllegalArgumentException("The time interval specify an negative range."); } if (startPosition < 0) { throw new IllegalArgumentException("Argument 'startPosition' can not be smaller than 0."); } if (maxResults < 1) { throw new IllegalArgumentException("Argument 'maxResults' can not be smaller than 1."); } this.service = service; this.parser = parser; this.builder = builder; this.interval = interval; this.startPosition = startPosition; this.maxResults = maxResults; }
From source file:net.sourceforge.fenixedu.util.date.IntervalTools.java
License:Open Source License
@Deprecated public static YearMonthDay getEndYMD(Interval interval) { long endTime = interval.getEndMillis(); return endTime == Long.MAX_VALUE ? null : new YearMonthDay(endTime); }
From source file:net.sourceforge.fenixedu.util.date.IntervalTools.java
License:Open Source License
public static LocalDate getEndLocalDate(Interval interval) { long endTime = interval.getEndMillis(); return endTime == Long.MAX_VALUE ? null : new LocalDate(endTime); }
From source file:net.sourceforge.fenixedu.util.date.IntervalTools.java
License:Open Source License
@Deprecated public static Interval intervalWithStart(Interval originalInterval, YearMonthDay day) { long millis = day.toDateMidnight().getMillis(); return new Interval(millis, originalInterval.getEndMillis()); }
From source file:net.sourceforge.fenixedu.util.date.IntervalTools.java
License:Open Source License
public static Interval intervalWithStart(Interval originalInterval, LocalDate day) { long millis = day.toDateMidnight().getMillis(); return new Interval(millis, originalInterval.getEndMillis()); }
From source file:net.sourceforge.fenixedu.util.date.IntervalTools.java
License:Open Source License
public static Interval intervalWithStart(Interval interval, Date date) { long millis = date == null ? Long.MIN_VALUE : date.getTime(); return new Interval(millis, interval.getEndMillis()); }
From source file:org.apache.calcite.adapter.druid.LocalInterval.java
License:Apache License
/** Creates a LocalInterval based on an interval string. */ public static LocalInterval create(String intervalString) { Interval i = new Interval(intervalString, ISOChronology.getInstanceUTC()); return new LocalInterval(i.getStartMillis(), i.getEndMillis()); }
From source file:org.apache.druid.client.CacheUtil.java
License:Apache License
public static Cache.NamedKey computeSegmentCacheKey(String segmentId, SegmentDescriptor descriptor, byte[] queryCacheKey) { final Interval segmentQueryInterval = descriptor.getInterval(); final byte[] versionBytes = StringUtils.toUtf8(descriptor.getVersion()); return new Cache.NamedKey(segmentId, ByteBuffer.allocate(16 + versionBytes.length + 4 + queryCacheKey.length) .putLong(segmentQueryInterval.getStartMillis()).putLong(segmentQueryInterval.getEndMillis()) .put(versionBytes).putInt(descriptor.getPartitionNumber()).put(queryCacheKey).array()); }