Class Timeline

java.lang.Object
edu.fiu.jtlex.data.Timeline
All Implemented Interfaces:
ITimeline, Iterable<String>, Iterator<String>

public class Timeline extends Object implements ITimeline, Iterator<String>, Iterable<String>
Default implementation of ITimeline.
Since:
Revision 260
Author:
Emmanuel Garcia
  • Constructor Details

    • Timeline

      public Timeline(List<List<String>> Timeline, Set<ILink> singleSlinks)
      Represents a Timeline of a TimeML graph, which is an ordered list of the events extracted from a TimeML Graph. TimeML annotations are converted into a collection of main and subordinated timelines arranged into a trunk-and-branch style structure. This class takes an ordered timeline, a set of attachment links, arranging them into a Timeline.
      Parameters:
      Timeline - produced by the Solve() method in the GraphTCSP.java class.
      singleSlinks - Set<ILink> produced by the partitionLinks() method in the Partitioner.java class.
      Throws:
      NullPointerException - if Timeline argument is null
  • Method Details

    • iterator

      public Iterator<String> iterator()
      Returns an iterator object that is used in for-each loops.
      Specified by:
      iterator in interface Iterable<String>
      Specified by:
      iterator in interface ITimeline
      Returns:
      an iterator object that is used in for-each loops.
      Since:
      Revision 376
    • hasNext

      public boolean hasNext()
      Checks if there are Timeline elements remaining in the list.
      Specified by:
      hasNext in interface Iterator<String>
      Specified by:
      hasNext in interface ITimeline
      Returns:
      true if there are Timeline elements remaining in the list.
      Since:
      Revision 260
    • next

      public String next() throws IndexOutOfBoundsException
      Returns next String representation of an event on the timeline.
      Specified by:
      next in interface Iterator<String>
      Specified by:
      next in interface ITimeline
      Returns:
      next String representation of an event on the timeline.
      Throws:
      IndexOutOfBoundsException
      Since:
      Revision 260
    • getMainTimeline

      public List<String> getMainTimeline()
      Returns the List<String> representation of the main Timeline in the graph.
      Specified by:
      getMainTimeline in interface ITimeline
      Returns:
      the List<String> representation of the main Timeline in the graph.
      Since:
      Revision 260
    • getSubordinationTimelines

      public List<List<String>> getSubordinationTimelines()
      Returns an ArrayList containing the Timelines belonging to the subordinating subgraphs.
      Specified by:
      getSubordinationTimelines in interface ITimeline
      Returns:
      an ArrayList containing the Timelines belonging to the subordinating subgraphs.
      Since:
      Revision 260
    • getTotalTimePoints

      public int getTotalTimePoints()
      Returns number of timepoints.
      Specified by:
      getTotalTimePoints in interface ITimeline
      Returns:
      the number of timepoints.
      Since:
      Revision 260
    • getAttachmentPoints

      public List<String> getAttachmentPoints()
      Returns a List containing the breaking points.
      Specified by:
      getAttachmentPoints in interface ITimeline
      Returns:
      a List containing the breaking points.
      Since:
      Revision 260
    • getFirstPoint

      public String getFirstPoint()
      Returns the first timepoint in the Timeline.
      Specified by:
      getFirstPoint in interface ITimeline
      Returns:
      the first timepoint in the Timeline.
      Since:
      Revision 260
    • getLastPoint

      public String getLastPoint()
      Returns the last timepoint in the Timeline.
      Specified by:
      getLastPoint in interface ITimeline
      Returns:
      the last timepoint in the Timeline.
      Since:
      Revision 260
    • getTimelineLength

      public int getTimelineLength()
      Returns the number of events in the timeline.
      Specified by:
      getTimelineLength in interface ITimeline
      Returns:
      the number of events in the timeline.
      Since:
      Revision 260
    • getTotalSubordinationBranches

      public int getTotalSubordinationBranches()
      Returns the total number of subordination branches in the graph.
      Specified by:
      getTotalSubordinationBranches in interface ITimeline
      Returns:
      the total number of subordination branches in the graph.
      Since:
      Revision 260
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJSON

      public String toJSON()
      Returns the JSON (RFC 8259) representation of the Timeline.
      Specified by:
      toJSON in interface ITimeline
      Returns:
      the JSON (RFC 8259) representation of the Timeline.
      Since:
      Revision 392