Package edu.fiu.jtlex.timeml.data
Class TimeMLText
java.lang.Object
edu.fiu.jtlex.timeml.data.TimeMLText
- All Implemented Interfaces:
ITimeMLText
Default implementation of
IText.- Since:
- jTLEX 1.0
- Author:
- arada002
-
Constructor Summary
ConstructorsConstructorDescriptionTimeMLText(String rawText, String text, Map<Integer, ITimeMLTimex> timexes, Set<ITimeMLLink> links, Set<ITimeMLInstance> instances, Map<Integer, ITimeMLEvent> events) Creates a new Text object. -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if this text equals an object.Returns the instances.Returns the instances.getLinks()Returns the links.Returns the raw text.getRelatedInstances(ITimeMLEvent event) Finds and returns the related instances to an event.getText()Returns the text.Returns the Timex's.inthashCode()Generates a hash code for the text.
-
Constructor Details
-
TimeMLText
public TimeMLText(String rawText, String text, Map<Integer, ITimeMLTimex> timexes, Set<ITimeMLLink> links, Set<ITimeMLInstance> instances, Map<Integer, ITimeMLEvent> events) Creates a new Text object.- Parameters:
rawText- Full article text including the tags. May not benulltext- Article text without the tags. May not benull.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 isnullIllegalArgumentException- 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
Returns the text.- Specified by:
getTextin interfaceITimeMLText- Returns:
- the String containing text.
- Since:
- jTLEX 1.0
-
getRawText
Returns the raw text.- Specified by:
getRawTextin interfaceITimeMLText- Returns:
- the String containing raw text.
- Since:
- jTLEX 1.0
-
getTimexes
Returns the Timex's.- Specified by:
getTimexesin interfaceITimeMLText- Returns:
- the set of ITimeMLTimex's.
- Since:
- jTLEX 1.0
-
getLinks
Returns the links.- Specified by:
getLinksin interfaceITimeMLText- Returns:
- the set of ITimeMLLinks.
- Since:
- jTLEX 1.0
-
getInstances
Returns the instances.- Specified by:
getInstancesin interfaceITimeMLText- Returns:
- the set of ITimeMLInstances.
- Since:
- jTLEX 1.0
-
getEvents
Returns the instances.- Specified by:
getEventsin interfaceITimeMLText- Returns:
- the set of ITimeMLEvents.
- Since:
- jTLEX 1.0
-
getRelatedInstances
Finds and returns the related instances to an event. May be null.- Specified by:
getRelatedInstancesin interfaceITimeMLText- 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:
hashCodein interfaceITimeMLText- Overrides:
hashCodein classObject- Returns:
- The hash code.
- Since:
- jTLEX 1.0
-
equals
Checks if this text equals an object.- Specified by:
equalsin interfaceITimeMLText- Overrides:
equalsin classObject- 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
-