Class TimeMLText

java.lang.Object
edu.fiu.jtlex.timeml.data.TimeMLText
All Implemented Interfaces:
ITimeMLText

public class TimeMLText extends Object implements ITimeMLText
Default implementation of IText.
Since:
jTLEX 1.0
Author:
arada002
  • Constructor Details

    • TimeMLText

      public TimeMLText(String rawText, String text, Map<Integer,ITimeMLTimex> timexes, Set<ITimeMLLink> links, Map<Integer,ITimeMLInstance> instances, Map<Integer,ITimeMLEvent> events)
      Creates a new Text object.
      Parameters:
      rawText - Full article text including the tags. May not be null
      text - Article text without the tags. May not be null.
      timexes - Map of timex objects. May not be empty.
      links - Set of link objects. May not be empty.
      instances - Set of makeInstance objects. May not be empty.
      events - Map of event objects. May not be empty.
      Throws:
      NullPointerException - If rawText or text argument is null
      IllegalArgumentException - If rawText or text argument is all whitespace or an empty string. If events, timexes, or links argument is an empty set.
  • Method Details

    • getText

      public String getText()
      Returns the text.
      Specified by:
      getText in interface ITimeMLText
      Returns:
      the String containing text.
      Since:
      jTLEX 1.0
    • getRawText

      public String getRawText()
      Returns the raw text.
      Specified by:
      getRawText in interface ITimeMLText
      Returns:
      the String containing raw text.
      Since:
      jTLEX 1.0
    • getTimexes

      public Set<ITimeMLTimex> getTimexes()
      Returns the Timex's.
      Specified by:
      getTimexes in interface ITimeMLText
      Returns:
      the set of ITimeMLTimex's.
      Since:
      jTLEX 1.0
    • getLinks

      public Set<ITimeMLLink> getLinks()
      Returns the links.
      Specified by:
      getLinks in interface ITimeMLText
      Returns:
      the set of ITimeMLLinks.
      Since:
      jTLEX 1.0
    • getInstances

      public Set<ITimeMLInstance> getInstances()
      Returns the instances.
      Specified by:
      getInstances in interface ITimeMLText
      Returns:
      the set of ITimeMLInstances.
      Since:
      jTLEX 1.0
    • getEvents

      public Set<ITimeMLEvent> getEvents()
      Returns the instances.
      Specified by:
      getEvents in interface ITimeMLText
      Returns:
      the set of ITimeMLEvents.
      Since:
      jTLEX 1.0
    • getRelatedInstances

      public Set<ITimeMLInstance> getRelatedInstances(ITimeMLEvent event)
      Finds and returns the related instances to an event. May be null.
      Specified by:
      getRelatedInstances in interface ITimeMLText
      Parameters:
      event - the event in question.
      Returns:
      a set of IInstances that are related to a given event.
      Since:
      jTLEX 1.0
    • hashCode

      public int hashCode()
      Generates a hash code for the text.
      Specified by:
      hashCode in interface ITimeMLText
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
      Since:
      jTLEX 1.0
    • equals

      public boolean equals(Object o)
      Checks if this text equals an object.
      Specified by:
      equals in interface ITimeMLText
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare against.
      Returns:
      True if both texts are equal, i.e. same rawText, or else false.
      Throws:
      NullPointerException - If the object to compare against is false.
      Since:
      jTLEX 1.0