Class Timeline

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

public class Timeline
extends java.lang.Object
implements ITimeline, java.util.Iterator<java.lang.String>, java.lang.Iterable<java.lang.String>
Default implementation of ITimeline.
Author:
Emmanuel Garcia
  • Constructor Summary

    Constructors 
    Constructor Description
    Timeline​(java.util.ArrayList<java.util.List<java.lang.String>> Timeline, java.util.Set<ILink> singleSlinks)
    Represents a Timeline of a TimeML graph, which is an ordered list of the events extracted from a TimeML Graph.
  • Method Summary

    Modifier and Type Method Description
    java.util.List<java.lang.String> getAttachmentPoints()
    Returns a List containing the breaking points from the Partitioning.java class.
    java.lang.String getFirstPoint()
    Returns the first timepoint in the Timeline.
    java.lang.String getLastPoint()
    Returns the last timepoint in the Timeline.
    java.util.List<java.lang.String> getMainTimeline()
    Returns the List<String> representation of the main Timeline in the graph.
    java.util.ArrayList<java.util.List<java.lang.String>> getSubordinationTimelines()
    Returns an ArrayList containing the Timelines belonging to the subordinating subgraphs.
    int getTimelineLength()
    Returns the number of events in the timeline.
    int getTotalSubordinationBranches()
    Returns the total number of subordination branches in the graph.
    int getTotalTimePoints()
    Returns number of timepoints.
    boolean hasNext()
    Checks if there are Timeline elements remaining in the list.
    java.util.Iterator<java.lang.String> iterator()
    Returns an iterator object that is used in for-each loops.
    java.lang.String next()
    Returns next String representation of an event on the timeline.
    java.lang.String toJSON()
    Returns the JSON (RFC 8259) representation of the Timeline.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.lang.Iterable

    forEach, spliterator

    Methods inherited from interface java.util.Iterator

    forEachRemaining, remove
  • Constructor Details

    • Timeline

      public Timeline​(java.util.ArrayList<java.util.List<java.lang.String>> Timeline, java.util.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:
      java.lang.NullPointerException - if Timeline argument is null
  • Method Details

    • iterator

      public java.util.Iterator<java.lang.String> iterator()
      Returns an iterator object that is used in for-each loops.
      Specified by:
      iterator in interface java.lang.Iterable<java.lang.String>
      Specified by:
      iterator in interface ITimeline
      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 java.util.Iterator<java.lang.String>
      Specified by:
      hasNext in interface ITimeline
      Returns:
      true if there are Timeline elements remaining in the list.
    • next

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

      public java.util.List<java.lang.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.
    • getSubordinationTimelines

      public java.util.ArrayList<java.util.List<java.lang.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.
    • getTotalTimePoints

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

      public java.util.List<java.lang.String> getAttachmentPoints()
      Returns a List containing the breaking points from the Partitioning.java class.
      Specified by:
      getAttachmentPoints in interface ITimeline
      Returns:
      a List containing the breaking points from the Partitioning.java class.
    • getFirstPoint

      public java.lang.String getFirstPoint()
      Returns the first timepoint in the Timeline.
      Specified by:
      getFirstPoint in interface ITimeline
      Returns:
      the first timepoint in the Timeline.
    • getLastPoint

      public java.lang.String getLastPoint()
      Returns the last timepoint in the Timeline.
      Specified by:
      getLastPoint in interface ITimeline
      Returns:
      the last timepoint in the Timeline.
    • 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.
    • 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.
    • toString

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

      public java.lang.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.