FileDocCategorySizeDatePackage
RSSChannelImpl.javaAPI DocAzureus 3.0.3.42674Thu Feb 09 19:43:06 GMT 2006org.gudy.azureus2.pluginsimpl.local.utils.xml.rss

RSSChannelImpl

public class RSSChannelImpl extends Object implements RSSChannel
author
parg

Fields Summary
private SimpleXMLParserDocumentNode
node
private RSSItem[]
items
Constructors Summary
protected RSSChannelImpl(SimpleXMLParserDocumentNode _node)

		node	= _node;
		
		SimpleXMLParserDocumentNode[]	xml_items = node.getChildren();
		
		List	its = new ArrayList();
		
		for (int i=0;i<xml_items.length;i++){
			
			SimpleXMLParserDocumentNode	xml_item = xml_items[i];
			
			if ( xml_item.getName().equalsIgnoreCase("item")){
				
				its.add( new RSSItemImpl( xml_item ));
			}
		}
		
		items	= new RSSItem[ its.size()];
		
		its.toArray( items );
	
Methods Summary
public java.lang.StringgetDescription()

		return( node.getChild( "description" ).getValue());
	
public RSSItem[]getItems()

		return( items );
	
public java.net.URLgetLink()

		try{
			return( new URL( node.getChild("link").getValue()));
			
		}catch( MalformedURLException e ){
		
			Debug.printStackTrace(e);
			
			return( null );
		}
	
public SimpleXMLParserDocumentNodegetNode()

		return( node );
	
public java.util.DategetPublicationDate()

			// optional attribute
		
		SimpleXMLParserDocumentNode	pd = node.getChild( "pubdate" );
		
		if ( pd == null ){
			
			return( null );
		}
		
		return( RSSUtils.parseDate( pd.getValue()));
	
public java.lang.StringgetTitle()

		return( node.getChild( "title" ).getValue());