|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Basic interface for a node containing text.
Most of the leaf data in a NewsML document occurs in nodes that
implement this interface, whether the nodes represent XML elements
or XML attributes. The normal way to get text is to use the toString()
method on a Text node, and the normal way to change text
is to use the setString(java.lang.String)
method. There are also
convenience methods for working with boolean and integer
values.
Method Summary | |
void |
setBoolean(boolean value)
Set a boolean value as text. |
void |
setInt(int value)
Set an integer as text. |
void |
setString(String value)
Set the text contents of the node. |
boolean |
toBoolean()
Convert the text to a boolean. |
int |
toInt()
Convert the text to an integer. |
String |
toString()
Get the text contents of the node. |
Methods inherited from interface org.newsml.toolkit.BaseNode |
getAttr, getChild, getChild, getChild, getChild, getChildCount, getChildCount, getParent, getPath, getSession, getXMLName, getXPath, insertAfter, insertAfter, insertAfter, insertAfter, insertAfterDuid, insertAfterDuid, insertBefore, insertBefore, insertBefore, insertBefore, insertBeforeDuid, insertBeforeDuid, insertChild, insertChild, insertFirst, insertFirst, insertLast, insertLast, removeChild, removeChild, removeSelf, replaceChild, replaceChild, replaceChild, replaceChild, replaceChild, replaceChild, setAttr, setAttr, toXML, toXML, unsetAttr, unsetAttr, writeXML, writeXML |
Method Detail |
public boolean toBoolean()
This method returns true if the string value is "yes", and false otherwise. It is particularly useful for the Essential and EquivalentsList attributes.
setInt(int)
,
setString(java.lang.String)
public void setBoolean(boolean value)
The resulting text will be "yes" for true or "no" for false.
value
- The boolean value to set.setInt(int)
,
setString(java.lang.String)
public int toInt()
toBoolean()
,
toString()
public void setInt(int value)
The result will always be displayed as base 10.
value
- The integer value to set.setBoolean(boolean)
,
setString(java.lang.String)
public String toString()
This method is the normal way to get leaf data from a NewsML
document; leaf nodes (elements or attributes) usually implement
the Text interface, and their data is available through
toString. toBoolean()
and toInt()
are also
available as special convenience methods.
toString
in class Object
toBoolean()
,
toInt()
public void setString(String value)
This method is the normal way to add leaf data to a NewsML
document; leaf nodes (elements or attributes) usually implement
the Text interface, and their data can be set through
setString. setBoolean(boolean)
and setInt(int)
are also
available as special convenience methods.
value
- The string value to set, replacing any current
text in the node.setBoolean(boolean)
,
setInt(int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |