org.newsml.toolkit
Interface Text

All Superinterfaces:
BaseNode
All Known Subinterfaces:
AssignedOriginText, AssignedText, BasisForChoice, Comment, Description, FormalNameDecl, IdText, Origin, OriginNode, OriginText, RevisionId, TransmissionId

public interface Text
extends BaseNode

Text without identifiers.

Version:
1.1beta
Author:
Reuters PLC

Method Summary
 boolean toBoolean()
          Convert the text to a boolean.
 int toInt()
          Convert the text to an integer.
 String toString()
          Override java.lang.toString().
 
Methods inherited from interface org.newsml.toolkit.BaseNode
getChild, getChild, getChild, getChild, getChildCount, getChildCount, getParent, getPath, getSession, getXMLName, getXPath, removeSelf, toXML, toXML, writeXML, writeXML
 

Method Detail

toBoolean

public boolean toBoolean()
Convert the text to a boolean.

This method returns true if the string value is "yes", and false otherwise. It is particularly useful for the Essential and EquivalentsList attributes.

Returns:
The text as a boolean.

toInt

public int toInt()
Convert the text to an integer.
Returns:
The text as an integer, or -1 if the text could not be parsed as a number.

toString

public String toString()
Override java.lang.toString().
Overrides:
toString in class Object
Returns:
The text value (content) as a string.