Package edu.fiu.jtlex.data
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
-
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.StringgetFirstPoint()Returns the first timepoint in the Timeline.java.lang.StringgetLastPoint()Returns the last timepoint in the Timeline.java.util.List<java.lang.String>getMainTimeline()Returns theList<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.intgetTimelineLength()Returns the number of events in the timeline.intgetTotalSubordinationBranches()Returns the total number of subordination branches in the graph.intgetTotalTimePoints()Returns number of timepoints.booleanhasNext()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.Stringnext()Returns next String representation of an event on the timeline.java.lang.StringtoJSON()Returns the JSON (RFC 8259) representation of the Timeline.java.lang.StringtoString()
-
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 isnull
-
-
Method Details
-
iterator
public java.util.Iterator<java.lang.String> iterator()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. -
next
public java.lang.String next() throws java.lang.IndexOutOfBoundsExceptionReturns next String representation of an event on the timeline. -
getMainTimeline
public java.util.List<java.lang.String> getMainTimeline()Returns theList<String>representation of the main Timeline in the graph.- Specified by:
getMainTimelinein interfaceITimeline- 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:
getSubordinationTimelinesin interfaceITimeline- Returns:
- an ArrayList containing the Timelines belonging to the subordinating subgraphs.
-
getTotalTimePoints
public int getTotalTimePoints()Returns number of timepoints.- Specified by:
getTotalTimePointsin interfaceITimeline- 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:
getAttachmentPointsin interfaceITimeline- 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:
getFirstPointin interfaceITimeline- Returns:
- the first timepoint in the Timeline.
-
getLastPoint
public java.lang.String getLastPoint()Returns the last timepoint in the Timeline.- Specified by:
getLastPointin interfaceITimeline- Returns:
- the last timepoint in the Timeline.
-
getTimelineLength
public int getTimelineLength()Returns the number of events in the timeline.- Specified by:
getTimelineLengthin interfaceITimeline- Returns:
- the number of events in the timeline.
-
getTotalSubordinationBranches
public int getTotalSubordinationBranches()Returns the total number of subordination branches in the graph.- Specified by:
getTotalSubordinationBranchesin interfaceITimeline- Returns:
- the total number of subordination branches in the graph.
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-
toJSON
public java.lang.String toJSON()Returns the JSON (RFC 8259) representation of the Timeline.
-