org.newsml.toolkit
Interface NewsItem

All Superinterfaces:
BaseNode, CatalogNode, CommentNode, EquivalentNode, IdNode, LanguageNode

public interface NewsItem
extends BaseNode, CatalogNode, CommentNode, EquivalentNode, IdNode, LanguageNode

A managed set of news information.

A news item is a branch in the NewsML content tree that attaches identification and management information to news objects; much of the interesting information (such as headlines and subheadlines, metadata, and the actual content) is available in or through the root news component (see getRootNewsComponent()). Alternatively, the news item may contain a topic set (i.e. a vocabulary being distributed) or deltas for an incremental update: see getRootTopicSet() and getUpdateCount().

Version:
2.0
Author:
Reuters PLC

Method Summary
 Identification getIdentification()
          Get the identification labels.
 NewsManagement getNewsManagement()
          Get the management information for the news item.
 NewsComponent getRootNewsComponent()
          Get the root component of the news item.
 TopicSet getRootTopicSet()
          Get the root topic set of the news item.
 Update[] getUpdate()
          Get all of the updates in this news item.
 Update getUpdate(int index)
          Get one of the updates in this news item.
 int getUpdateCount()
          Count the updates present in this news item.
 
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
 
Methods inherited from interface org.newsml.toolkit.CatalogNode
getCatalog
 
Methods inherited from interface org.newsml.toolkit.CommentNode
getComment, getComment, getCommentCount
 
Methods inherited from interface org.newsml.toolkit.EquivalentNode
getBasisForChoiceNodes
 
Methods inherited from interface org.newsml.toolkit.IdNode
getDuid, getEuid
 
Methods inherited from interface org.newsml.toolkit.LanguageNode
getLang
 

Method Detail

getIdentification

public Identification getIdentification()
Get the identification labels.
Returns:
An object containing the identification labels for this news item (not null).

getNewsManagement

public NewsManagement getNewsManagement()
Get the management information for the news item. The management information includes the type of the news item, its status (including whether it's embargoed), when it was created, and similar information.
Returns:
An object containing the management information for the news item (not null).

getRootNewsComponent

public NewsComponent getRootNewsComponent()
Get the root component of the news item.

Return the root component of the news item. The component contains newslines, metadata, and other similar information, and is the beginning of the path down the NewsML tree to the actual content. If this method returns a non-null value, getRootTopicSet() must return null and getUpdateCount() must return 0.

Returns:
The root news component, or null if none was specified.

getRootTopicSet

public TopicSet getRootTopicSet()
Get the root topic set of the news item.

If the topic set is present, it is actually the payload of this newsitem, rather than simply metadata describing the payload. If this method returns a non-null value, getRootNewsComponent() must return null and getUpdateCount() must return 0.

Returns:
The root topic set, or null if none was specified.

getUpdateCount

public int getUpdateCount()
Count the updates present in this news item.

If the news item contains deltas rather than a news component or topic set, the deltas will be accessible through a series of Update objects. If this method returns a non-zero value, getRootNewsComponent() and getRootTopicSet() must both return null.

Returns:
The number of updates present.
See Also:
getUpdate(int)

getUpdate

public Update getUpdate(int index)
Get one of the updates in this news item.
Parameters:
index - The index of the update to get.
Returns:
The update, or null if the index is out of range.
See Also:
getUpdateCount(), getUpdate()

getUpdate

public Update[] getUpdate()
Get all of the updates in this news item.
Returns:
All of the update nodes in an array (the array may be empty).
See Also:
getUpdate(int)