Class Timeline

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

public class Timeline extends Object implements Iterator<String>, Iterable<String>
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, and an array list of partitioned graphs, arranging them into a Timeline.
Author:
Emmanuel Garcia
  • Constructor Details

    • Timeline

      public Timeline​(ArrayList<List<String>> Timeline, Set<ILink> singleSlinks)
      TODO: Document Description
      Parameters:
      Timeline - produced by the Solve() method in the GraphTCSP.java class.
      singleSlinks - Set<ILink> produced by the partitionLinks() method in the IGraphPartitioner.java class.
  • 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>
      Returns:
      an iterator object that is used in for-each loops.
    • hasNext

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

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

      public List<String> getMainTimeline()
      Returns the List<String> representation of the main Timeline in the graph.
      Returns:
      the List<String> representation of the main Timeline in the graph.
    • getSubordinationTimelines

      public ArrayList<List<String>> getSubordinationTimelines()
      Returns an ArrayList containing the Timelines belonging to the subordinating subgraphs.
      Returns:
      an ArrayList containing the Timelines belonging to the subordinating subgraphs.
    • getTotalTimePoints

      public int getTotalTimePoints()
      Returns number of timepoints.
      Returns:
      the number of timepoints.
    • getAttachmentPoints

      public List<String> getAttachmentPoints()
      Returns a List containing the breaking points from the Partitioning.java class.
      Returns:
      a List containing the breaking points from the Partitioning.java class.
    • getFirstPoint

      public String getFirstPoint()
      Returns the first timepoint in the Timeline.
      Returns:
      the first timepoint in the Timeline.
    • getLastPoint

      public String getLastPoint()
      Returns the last timepoint in the Timeline.
      Returns:
      the last timepoint in the Timeline.
    • getTimelineLength

      public int getTimelineLength()
      Returns the number of events in the timeline.
      Returns:
      the number of events in the timeline.
    • getTotalSubordinationBranches

      public int getTotalSubordinationBranches()
      Returns the total number of subordination branches in the graph.
      Returns:
      the total number of subordination branches in the graph.
    • toString

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

      public String toJSON()
      Returns the JSON (RFC 8259) representation of the Timeline.
      Returns:
      the JSON (RFC 8259) representation of the Timeline.