public class PartitionedTimeInterval<T extends TimeInterval> extends Object implements Iterable<T>
TimeInterval The composing
time intervals are considered closed at start and open at end [start, end)
It is implemented as a copy on write array and its thread safe.| Constructor and Description |
|---|
PartitionedTimeInterval() |
| Modifier and Type | Method and Description |
|---|---|
TimeInterval |
get(int i) |
T |
getFit(long t)
returns an interval where t would fit or null if there is no such
interval
|
T |
insert(T timeInterval)
Inserts an interval in the list if it doesn't overlap with an existing one.
|
T |
insert(T x,
long tolerance)
Insert a new time interval in the list, if it doesn't overlap with the
existing intervals.
|
Iterator<T> |
iterator() |
Iterator<T> |
overlappingIterator(TimeInterval timeInterval)
Creates an iterator that iterates over all the timeintervals overlapping
with timeInterval The timeInterval is considered closed at both ends
[start, stop]
|
Iterator<T> |
overlappingReverseIterator(TimeInterval timeInterval)
Creates an iterator that iterates over all the timeintervals overlapping
with timeInterval The timeInterval is considered closed at both ends
[start, stop]
|
Iterator<T> |
reverseIterator() |
int |
size() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic T insert(T x, long tolerance)
public T insert(T timeInterval)
public Iterator<T> overlappingIterator(TimeInterval timeInterval)
public Iterator<T> overlappingReverseIterator(TimeInterval timeInterval)
public T getFit(long t)
public int size()
public Iterator<T> iterator()
iterator in interface Iterable<T extends TimeInterval>public TimeInterval get(int i)
Copyright © 2018 Space Applications Services. All rights reserved.