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, Map<Integer, ITimeMLInstance> instances, Map<Integer, ITimeMLEvent> events) Creates a new Text object. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks 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.int
hashCode()
Generates a hash code for the text.
-
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 benull
text
- 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 isnull
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
Returns the text.- Specified by:
getText
in interfaceITimeMLText
- Returns:
- the String containing text.
- Since:
- jTLEX 1.0
-
getRawText
Returns the raw text.- Specified by:
getRawText
in interfaceITimeMLText
- Returns:
- the String containing raw text.
- Since:
- jTLEX 1.0
-
getTimexes
Returns the Timex's.- Specified by:
getTimexes
in interfaceITimeMLText
- Returns:
- the set of ITimeMLTimex's.
- Since:
- jTLEX 1.0
-
getLinks
Returns the links.- Specified by:
getLinks
in interfaceITimeMLText
- Returns:
- the set of ITimeMLLinks.
- Since:
- jTLEX 1.0
-
getInstances
Returns the instances.- Specified by:
getInstances
in interfaceITimeMLText
- Returns:
- the set of ITimeMLInstances.
- Since:
- jTLEX 1.0
-
getEvents
Returns the instances.- Specified by:
getEvents
in 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:
getRelatedInstances
in 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:
hashCode
in interfaceITimeMLText
- Overrides:
hashCode
in classObject
- Returns:
- The hash code.
- Since:
- jTLEX 1.0
-
equals
Checks if this text equals an object.- Specified by:
equals
in interfaceITimeMLText
- Overrides:
equals
in 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
-