Package edu.fiu.jtlex.timeml.timeline
Class TimeMLTimeline
java.lang.Object
edu.fiu.jtlex.timeml.timeline.TimeMLTimeline
- All Implemented Interfaces:
ITimeMLTimeline,Iterable<String>,Iterator<String>
public class TimeMLTimeline
extends Object
implements ITimeMLTimeline, Iterator<String>, Iterable<String>
Default implementation of
ITimeline.- Since:
- jTLEX 1.0
- Author:
- Emmanuel Garcia
-
Constructor Summary
ConstructorsConstructorDescriptionTimeMLTimeline(List<List<String>> Timeline, Set<ITimeMLLink> 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 TypeMethodDescriptionbooleanChecks if this Timeline equals an object.Returns a List containing the breaking points.Returns the first timepoint in the Timeline.Returns the last timepoint in the Timeline.Returns theList<String>representation of the main Timeline in the graph.Returns an ArrayList containing the Timelines belonging to the subordinating subgraphs.intReturns the number of events in the timeline.intReturns the total number of subordination branches in the graph.intReturns number of timepoints.inthashCode()Generates a hash code for the timeline.booleanhasNext()Checks if there are Timeline elements remaining in the list.iterator()Returns an iterator object that is used in for-each loops.next()Returns next String representation of an event on the timeline.toJson()Returns the JSON (RFC 8259) representation of the Timeline.toString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Constructor Details
-
TimeMLTimeline
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 isnull
-
-
Method Details
-
iterator
Returns an iterator object that is used in for-each loops.- Specified by:
iteratorin interfaceIterable<String>- Specified by:
iteratorin interfaceITimeMLTimeline- Returns:
- an iterator object that is used in for-each loops.
- Since:
- jTLEX 1.0
-
hasNext
public boolean hasNext()Checks if there are Timeline elements remaining in the list.- Specified by:
hasNextin interfaceIterator<String>- Specified by:
hasNextin interfaceITimeMLTimeline- Returns:
- true if there are Timeline elements remaining in the list.
- Since:
- jTLEX 1.0
-
next
Returns next String representation of an event on the timeline.- Specified by:
nextin interfaceIterator<String>- Specified by:
nextin interfaceITimeMLTimeline- Returns:
- next String representation of an event on the timeline.
- Throws:
IndexOutOfBoundsException- Since:
- jTLEX 1.0
-
getMainTimeline
Returns theList<String>representation of the main Timeline in the graph.- Specified by:
getMainTimelinein interfaceITimeMLTimeline- Returns:
- the
List<String>representation of the main Timeline in the graph. - Since:
- jTLEX 1.0
-
getSubordinationTimelines
Returns an ArrayList containing the Timelines belonging to the subordinating subgraphs.- Specified by:
getSubordinationTimelinesin interfaceITimeMLTimeline- Returns:
- an ArrayList containing the Timelines belonging to the subordinating subgraphs.
- Since:
- jTLEX 1.0
-
getTotalTimePoints
public int getTotalTimePoints()Returns number of timepoints.- Specified by:
getTotalTimePointsin interfaceITimeMLTimeline- Returns:
- the number of timepoints.
- Since:
- jTLEX 1.0
-
getAttachmentPoints
Returns a List containing the breaking points.- Specified by:
getAttachmentPointsin interfaceITimeMLTimeline- Returns:
- a List containing the breaking points.
- Since:
- jTLEX 1.0
-
getFirstPoint
Returns the first timepoint in the Timeline.- Specified by:
getFirstPointin interfaceITimeMLTimeline- Returns:
- the first timepoint in the Timeline.
- Since:
- jTLEX 1.0
-
getLastPoint
Returns the last timepoint in the Timeline.- Specified by:
getLastPointin interfaceITimeMLTimeline- Returns:
- the last timepoint in the Timeline.
- Since:
- jTLEX 1.0
-
getTimelineLength
public int getTimelineLength()Returns the number of events in the timeline.- Specified by:
getTimelineLengthin interfaceITimeMLTimeline- Returns:
- the number of events in the timeline.
- Since:
- jTLEX 1.0
-
getTotalSubordinationBranches
public int getTotalSubordinationBranches()Returns the total number of subordination branches in the graph.- Specified by:
getTotalSubordinationBranchesin interfaceITimeMLTimeline- Returns:
- the total number of subordination branches in the graph.
- Since:
- jTLEX 1.0
-
toString
-
toJson
Returns the JSON (RFC 8259) representation of the Timeline.- Specified by:
toJsonin interfaceITimeMLTimeline- Returns:
- the JSON (RFC 8259) representation of the Timeline.
- Since:
- jTLEX 1.0
-
hashCode
public int hashCode()Generates a hash code for the timeline.- Specified by:
hashCodein interfaceITimeMLTimeline- Overrides:
hashCodein classObject- Returns:
- The hash code.
- Since:
- jTLEX 1.0
-
equals
Checks if this Timeline equals an object.- Specified by:
equalsin interfaceITimeMLTimeline- Overrides:
equalsin classObject- Parameters:
o- The object to compare against.- Returns:
- True if timelines are equal, i.e. same mainTimeline and timelines, or else false.
- Throws:
NullPointerException- If the object to compare against is false.- Since:
- jTLEX 1.0
-