org.newsml.toolkit
Interface SubjectCode

All Superinterfaces:
AssignmentNode, BaseNode, IdNode

public interface SubjectCode
extends AssignmentNode, BaseNode, IdNode

An IPTC subject code from the IPTC Information Interchange Model (IIM).

The subject code is part of the DescriptiveMetadata for a NewsComponent.

Although the NewsML documentation limits this property to IPTC subject codes, the fact that the codes are formal names implies that other vocabularies could be used; programmers should take care using this interface until the IPTC clarifies the situation, since providers may choose to take a liberal interpretation.

Version:
2.0
Author:
Reuters PLC

Method Summary
 SubjectCodeItem[] getItem()
          Convenience method: get all Item children in an array.
 SubjectCodeItem getItem(int index)
          Convenience method: get an item from the subject code.
 int getItemCount()
          Convenience method: count the items available in this subject code.
 AssignedFormalName[] getSubject()
          Get an array of all subjects in the code.
 AssignedFormalName getSubject(int index)
          Get the IIM code for the subject of a news item.
 int getSubjectCount()
          Count the subjects in the code.
 AssignedFormalName[] getSubjectDetail()
          Get an array of all subject details in the code.
 AssignedFormalName getSubjectDetail(int index)
          Get the IIM code for a subject detail of a news item.
 int getSubjectDetailCount()
          Count the subject details in the code.
 AssignedFormalName[] getSubjectMatter()
          Get an array of all subject matter in the code.
 AssignedFormalName getSubjectMatter(int index)
          Get the IIM code for the subject matter of a news item.
 int getSubjectMatterCount()
          Count the subject matter in the code.
 AssignedFormalName[] getSubjectQualifier()
          Get an array of all subject qualifiers in the code.
 AssignedFormalName getSubjectQualifier(int index)
          Get the IIM code for a subject qualifier.
 int getSubjectQualifierCount()
          Count the subject qualifiers in the code.
 
Methods inherited from interface org.newsml.toolkit.AssignmentNode
getAssignedBy, getAssignmentDateAndTime, getConfidence, getHowPresent, getImportance
 
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.IdNode
getDuid, getEuid
 

Method Detail

getSubjectCount

public int getSubjectCount()
Count the subjects in the code.
Returns:
The number of subjects.
See Also:
getSubject(int), getSubject()

getSubject

public AssignedFormalName getSubject(int index)
Get the IIM code for the subject of a news item.
Parameters:
index - The index of the subject, zero-based, in document order.
Returns:
The subject, or null if none exists at the specified index.
See Also:
getSubjectCount(), getSubject()

getSubject

public AssignedFormalName[] getSubject()
Get an array of all subjects in the code.
Returns:
A possibly-empty array of subjects (not null).
See Also:
getSubjectCount(), getSubject(int)

getSubjectMatterCount

public int getSubjectMatterCount()
Count the subject matter in the code.
Returns:
The number of subject matter objects.
See Also:
getSubjectMatter(int), getSubjectMatter()

getSubjectMatter

public AssignedFormalName getSubjectMatter(int index)
Get the IIM code for the subject matter of a news item.
Parameters:
index - The index of the subject matter, zero-based, in document order.
Returns:
The subject matter, or null if none exists at the specified index.
See Also:
getSubjectMatterCount(), getSubjectMatter()

getSubjectMatter

public AssignedFormalName[] getSubjectMatter()
Get an array of all subject matter in the code.
Returns:
A possibly-empty array of subject matters (not null).
See Also:
getSubjectMatterCount(), getSubjectMatter(int)

getSubjectDetailCount

public int getSubjectDetailCount()
Count the subject details in the code.
Returns:
The number of subject details.
See Also:
getSubjectDetail(int), getSubjectDetail()

getSubjectDetail

public AssignedFormalName getSubjectDetail(int index)
Get the IIM code for a subject detail of a news item.
Parameters:
index - The index of the subject detail, zero-based, in document order.
Returns:
The subject detail, or null if none exists at the specified index.
See Also:
getSubjectDetailCount(), getSubjectDetail()

getSubjectDetail

public AssignedFormalName[] getSubjectDetail()
Get an array of all subject details in the code.
Returns:
A possibly-empty array of subject details (not null).
See Also:
getSubjectDetailCount(), getSubjectDetail(int)

getSubjectQualifierCount

public int getSubjectQualifierCount()
Count the subject qualifiers in the code.
Returns:
The number of subject qualifiers.
See Also:
getSubjectQualifier(int), getSubjectQualifier()

getSubjectQualifier

public AssignedFormalName getSubjectQualifier(int index)
Get the IIM code for a subject qualifier.

Note: since every subject, subject matter, or subject detail may have zero or more qualifiers, the index of the qualifier will not likely have any correspondence to the index of the thing it qualifiers; to obtain qualifiers grouped with the things they qualify, use the getItem(int) method.

Parameters:
index - The index of the subject qualifier, zero-based, in document order.
Returns:
The subject qualifier, or null if none exists at the specified index.
See Also:
getSubjectQualifierCount(), getSubjectQualifier()

getSubjectQualifier

public AssignedFormalName[] getSubjectQualifier()
Get an array of all subject qualifiers in the code.
Returns:
A possibly-empty array of subject qualifiers (not null).
See Also:
getSubjectQualifierCount(), getSubjectQualifier(int)

getItemCount

public int getItemCount()
Convenience method: count the items available in this subject code.
Returns:
The number of items available.
See Also:
getItem(int)

getItem

public SubjectCodeItem getItem(int index)
Convenience method: get an item from the subject code.

The item includes a single piece of Subject, SubjectMatter, or Subject information together with zero or more SubjectQualifiers.

Parameters:
index - The index of the item, zero-based, numbered sequentially.
Returns:
The item, or null if none was provided at the specified index.

getItem

public SubjectCodeItem[] getItem()
Convenience method: get all Item children in an array.
Returns:
A (possibly-empty) array of Item children.