Package gaiasky.util.gaia.time
Class GtiList
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable<Gti>
,Collection<Gti>
,List<Gti>
,RandomAccess
A collection of Good Time Intervals (GTIs).
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(long start, long end) Convenience method to add a new GTIvoid
combine list with second list (logical AND) Return this List combined with second listdouble
Compute the sum of the TimeIntervalsinside
(long time) Check if a time is within any GTI in the listboolean
Is the list reduced?boolean
isSorted()
Is the list sorted?void
combine list with second list (logical OR)void
reduce()
Combine overlapping intervals (logical OR)void
sortIt()
sort the list such that t_i_start invalid input: '<'= t_i+1_start forall i=0, this->size()-1toString()
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll
-
Constructor Details
-
GtiList
public GtiList()Create an empty GTI List
-
-
Method Details
-
add
Convenience method to add a new GTI- Parameters:
start
- Tend
- T- Throws:
RuntimeException
-
inside
Check if a time is within any GTI in the list- Parameters:
time
- time to find- Returns:
- first GTI object in which the time the time is found, null otherwise
-
sortIt
public void sortIt()sort the list such that t_i_start invalid input: '<'= t_i+1_start forall i=0, this->size()-1 -
or
combine list with second list (logical OR)+----------------+ Gti 1 ( +-----------+ Gti 2 || \/ +-------------------+ combined
- Parameters:
list
- List to combine with- Throws:
RuntimeException
-
and
combine list with second list (logical AND) Return this List combined with second list+----------------+ Gti 1 +-----------+ Gti 2 || \/ +-------+ combined
- Parameters:
list
- List to combine with- Throws:
RuntimeException
-
reduce
Combine overlapping intervals (logical OR)+----------------+ Gti 1 +-----------+ Gti 2 || \/ +-------------------+ combined
- Throws:
RuntimeException
-
getOntime
public double getOntime()Compute the sum of the TimeIntervals- Returns:
- sum of all GTI durations [s]
-
isSorted
public boolean isSorted()Is the list sorted?- Returns:
- true if the list sorted, false otherwise
-
isReduced
public boolean isReduced()Is the list reduced?- Returns:
- true if the list reduced, false otherwise
-
toString
- Overrides:
toString
in classAbstractCollection<Gti>
- Returns:
- String
-