Class GtiList

All Implemented Interfaces:
Serializable, Cloneable, Iterable<Gti>, Collection<Gti>, List<Gti>, RandomAccess

public class GtiList extends ArrayList<Gti>
A collection of Good Time Intervals (GTIs).
See Also:
  • Constructor Details

    • GtiList

      public GtiList()
      Create an empty GTI List
  • Method Details

    • add

      public void add(long start, long end) throws RuntimeException
      Convenience method to add a new GTI
      Parameters:
      start - T
      end - T
      Throws:
      RuntimeException
    • inside

      public Gti inside(long time)
      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

      public void or(GtiList list) throws RuntimeException
      combine list with second list (logical OR)
          +----------------+ Gti 1 (
       +-----------+ Gti 2
       ||
       \/
       +-------------------+ combined
       
      Parameters:
      list - List to combine with
      Throws:
      RuntimeException
    • and

      public void and(GtiList list) throws RuntimeException
      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

      public void reduce() throws RuntimeException
      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

      public String toString()
      Overrides:
      toString in class AbstractCollection<Gti>
      Returns:
      String