import components.simplereader.SimpleReader; import components.simplereader.SimpleReader1L; import components.simplewriter.SimpleWriter; import components.simplewriter.SimpleWriter1L; import components.xmltree.XMLTree; import components.xmltree.XMLTree1; /** * This program inputs an XML RSS (version 2.0) feed from a given URL and * outputs various elements of the feed to the console. * * @author Put your name here * */ public final class RSSProcessing { /** * Private constructor so this utility class cannot be instantiated. */ private RSSProcessing() { } /** * Finds the first occurrence of the given tag among the children of the * given {@code XMLTree} and return its index; returns -1 if not found. * * @param xml * the {@code XMLTree} to search * @param tag * the tag to look for * @return the index of the first child of the {@code XMLTree} matching the * given tag or -1 if not found * @requires [the label of the root of xml is a tag] * @ensures
* getChildElement = * [the index of the first child of the {@code XMLTree} matching the * given tag or -1 if not found] **/ private static int getChildElement(XMLTree xml, String tag) { assert xml != null : "Violation of: xml is not null"; assert tag != null : "Violation of: tag is not null"; assert xml.isTag() : "Violation of: the label root of xml is a tag"; /* * TODO: #1 - fill in body */ } /** * Processes one news item and outputs the title, or the description if the * title is not present, and the link (if available) with appropriate * labels. * * @param item * the news item * @param out * the output stream * @requires * [the label of the root of item is an