Package edu.fiu.jtlex.data
Class Timex
java.lang.Object
edu.fiu.jtlex.data.Timex
Default implementation of
ITimex.- Author:
- ceber003
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.fiu.jtlex.data.ITimex
ITimex.FunctionInDocument, ITimex.TimexMod, ITimex.TimexType -
Constructor Summary
ConstructorsConstructorDescriptionTimex(int tID, ITimex.TimexType type, String value, ITimex.TimexMod mod, boolean temporalFunction, int anchorID, ITimex.FunctionInDocument documentFunction, int beginPoint, int endPoint, String quant, String freq, String phrase)Creates a new Timex with the specified information. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a link to the set of IN links from this node.voidaddOutLink(ILink link)Add a link to the set of OUT links from this node.clone()intReturns the integer part of the anchortimeId.Returns the string part of the anchortimeId.intReturns the integer part of the beginpointId.Returns the string part of the beginpointId.intReturns the integer part of the endpointId.Returns the string part of the endpointId.getFreq()Returns frequency String portion.Returns the function to which the object belongs.intgetId()Returns the integer part of the node ID.getIdStr()Returns the full string representation of the node ID.Returns the set of TimeML links which come to this node.getMod()Returns the mod to which the object belongs.Returns the set of TimeML links which come from this node.Returns the phrase from the text annotated as timex.getQuant()Returns the quantity to which the object belongs.booleanReturns the inary attribute which expresses that the value of the temporal expression needs to be determined via evaluation of a temporal function.getType()Return the integer that corresponds with the type.getValue()Returns the string representation of the value.voidremoveInLink(ILink link)Removes a TimeML link from the set of links that end in this node.voidremoveOutLink(ILink link)Removes a TimeML link from the set of links that start in this node.toJSON()Returns the JSON (RFC 8259) representation of the Node.toString()
-
Constructor Details
-
Timex
public Timex(int tID, ITimex.TimexType type, String value, ITimex.TimexMod mod, boolean temporalFunction, int anchorID, ITimex.FunctionInDocument documentFunction, int beginPoint, int endPoint, String quant, String freq, String phrase)Creates a new Timex with the specified information.- Parameters:
tID- id of the timex; may not be negativetype- the type of the timex may not be nullvalue- the value attribute of the timexmod- the mod of the value, is optionaltemporalFunction- true or falseanchorID- the id of another timex anchored to the current timex, optionaldocumentFunction- the function a timex is providing within the document, is 'NONE' when not specified.beginPoint- beginpoint is used if the timex is anchored to another, can be nullendPoint- end is used if timex is anchored to another timex, can be nullquant- used only if timex type is 'SET' is the literal describing the timex rate of occurrencefreq- used only if timex type is 'SET' is the frequency the timex occursphrase- the phase associated with this this timex.- Throws:
NullPointerException- if type or value is nullIllegalArgumentException- if tID, acnhorId, beginPoint, or endPoint is negative
-
-
Method Details
-
getId
public int getId()Description copied from interface:INodeReturns the integer part of the node ID. Each event has to be identified by a unique ID number. -
getIdStr
Description copied from interface:INodeReturns the full string representation of the node ID. Each event has to be identified by a unique ID number and String. -
getType
Description copied from interface:INodeReturn the integer that corresponds with the type. Each event can be categorized under three different types. -
getValue
Description copied from interface:ITimexReturns the string representation of the value. The value of the the timex tag determines what the actual amount of time for the date, time, duration, and set types. -
getMod
Description copied from interface:ITimexReturns the mod to which the object belongs. This value is optional.- Specified by:
getModin interfaceITimex- Returns:
- the mod to which the object belongs.
May be
null. - See Also:
ITimex.TimexMod
-
getTemporalFunction
public boolean getTemporalFunction()Description copied from interface:ITimexReturns the inary attribute which expresses that the value of the temporal expression needs to be determined via evaluation of a temporal function.- Specified by:
getTemporalFunctionin interfaceITimex- Returns:
- the inary attribute which expresses that the value of the temporal expression needs to be determined via evaluation of a temporal function.
-
getAnchorTimeId
public int getAnchorTimeId()Description copied from interface:ITimexReturns the integer part of the anchortimeId. Each anchortime has to be identified by a unique ID number. This value is optional.- Specified by:
getAnchorTimeIdin interfaceITimex- Returns:
- the integer part of the anchortimeId. May not be negative
-
getAnchorTimeIdStr
Description copied from interface:ITimexReturns the string part of the anchortimeId. Each anchortime has to be identified by a unique ID number. This value is optional.- Specified by:
getAnchorTimeIdStrin interfaceITimex- Returns:
- the string part of the anchortimeId. May not be null.
-
getFunction
Description copied from interface:ITimexReturns the function to which the object belongs. Function in document can be one of seven values. If it is not specified then it will be set as 'NONE' by default.- Specified by:
getFunctionin interfaceITimex- Returns:
- the function to which the object belongs.
May be
null.
-
getBeginPoint
public int getBeginPoint()Description copied from interface:ITimexReturns the integer part of the beginpointId. Beginpoint is only used if the expression is anchored to another timex expression. Each beginpoint has to be identified by a unique ID number. If only endpoint is provided may create an empty timex to fill in.- Specified by:
getBeginPointin interfaceITimex- Returns:
- the integer part of the beginpointId. May not be negative
-
getBeginPointStr
Description copied from interface:ITimexReturns the string part of the beginpointId. Beginpoint is only used if the expression is anchored to another timex expression. Each beginpoint has to be identified by a unique ID number. If only endpoint is provided may create an empty timex to fill in.- Specified by:
getBeginPointStrin interfaceITimex- Returns:
- the string part of the beginpointId.
May not be
null.
-
getEndPoint
public int getEndPoint()Description copied from interface:ITimexReturns the integer part of the endpointId. Endpoint is only used if the expression is anchored to another timex expression. Each endpoint has to be identified by a unique ID number. If only beginpoint is provided may create an empty timex to fill in.- Specified by:
getEndPointin interfaceITimex- Returns:
- the integer part of the endpointId. May not be negative.
-
getEndPointStr
Description copied from interface:ITimexReturns the string part of the endpointId. Endpoint is only used if the expression is anchored to another timex expression. Each endpoint has to be identified by a unique ID number. If only beginpoint is provided may create an empty timex to fill in.- Specified by:
getEndPointStrin interfaceITimex- Returns:
- the string part of the endpointId.
May not be
null.
-
getQuant
Description copied from interface:ITimexReturns the quantity to which the object belongs. The quant value is only used if the timex type is 'SET'. -
getFreq
Description copied from interface:ITimexReturns frequency String portion. The frequency value is only used if the timex type is 'SET'. The integer value determines the number of time the frequency takes. i.e: 2 Weeks, 3 Months, 1 Day, etc. -
getPhrase
Description copied from interface:ITimexReturns the phrase from the text annotated as timex. -
addOutLink
Description copied from interface:ITimexAdd a link to the set of OUT links from this node.- Specified by:
addOutLinkin interfaceINode- Specified by:
addOutLinkin interfaceITimex- Parameters:
link- : A new OUT link from this node.
-
addInLink
Description copied from interface:ITimexAdd a link to the set of IN links from this node. -
getOutLinks
Description copied from interface:ITimexReturns the set of TimeML links which come from this node.- Specified by:
getOutLinksin interfaceINode- Specified by:
getOutLinksin interfaceITimex- Returns:
- the set of TimeML links which come from this node.
-
getInLinks
Description copied from interface:ITimexReturns the set of TimeML links which come to this node.- Specified by:
getInLinksin interfaceINode- Specified by:
getInLinksin interfaceITimex- Returns:
- the set of TimeML links which come to this node.
-
removeOutLink
Description copied from interface:ITimexRemoves a TimeML link from the set of links that start in this node.- Specified by:
removeOutLinkin interfaceINode- Specified by:
removeOutLinkin interfaceITimex- Parameters:
link- a new OUT link to remove from the set of outgoing links.
-
removeInLink
Description copied from interface:ITimexRemoves a TimeML link from the set of links that end in this node.- Specified by:
removeInLinkin interfaceINode- Specified by:
removeInLinkin interfaceITimex- Parameters:
link- a new In link to remove from the set of incoming links.
-
toString
-
toJSON
Description copied from interface:INodeReturns the JSON (RFC 8259) representation of the Node. -
clone
-