Copyright (c) 2000-2002 ChurchillObjects.com

churchillobjects.rss4j
Class RssDocument

java.lang.Object
  |
  +--churchillobjects.rss4j.RssDocument
All Implemented Interfaces:
java.lang.Cloneable, RssVersion, java.io.Serializable

public class RssDocument
extends java.lang.Object
implements RssVersion, java.lang.Cloneable, java.io.Serializable

Encapsulates the data and some minor logic regarding a document in the RSS object model. The document contains all of the elements inside of it, beginning with the channel.

See Also:
Serialized Form

Field Summary
private  java.util.Vector channels
          Holds the channels for the RSS document.
private  java.lang.String version
          Holds the version for the RSS document.
private  java.util.Vector warnings
          Holds the warnings that were generated by the parser when this document object was parsed from an RSS document.
 
Fields inherited from interface churchillobjects.rss4j.model.RssVersion
VERSION_10, VERSION_90, VERSION_91
 
Constructor Summary
RssDocument()
          Default constructor.
RssDocument(java.lang.String version)
          Overloaded constructor to set the version number.
 
Method Summary
 void addChannel(churchillobjects.rss4j.RssChannel channel)
          Adds a channel to the document.
 void addWarning(java.lang.String s)
          Adds a warning to the document.
 java.util.Enumeration channels()
          Returns an enumeration of channels to the document.
 java.lang.Object clone()
          Public clone method to allow cloning.
 boolean equals(java.lang.Object obj)
          Canonical equals method.
 java.lang.String getVersion()
          Returns the RSS version number of the document.
 int hashCode()
          Computes the hashcode of this object based on the hashcodes of the objects it contains.
 void setVersion(java.lang.String s)
          Sets the RSS version number of the document.
 java.lang.String toString()
          Returns a string representation of this object.
 java.util.Enumeration warnings()
          Returns an enumeration of the current warnings.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

channels

private java.util.Vector channels
Holds the channels for the RSS document.


version

private java.lang.String version
Holds the version for the RSS document.


warnings

private java.util.Vector warnings
Holds the warnings that were generated by the parser when this document object was parsed from an RSS document.

Constructor Detail

RssDocument

public RssDocument()
Default constructor.


RssDocument

public RssDocument(java.lang.String version)
Overloaded constructor to set the version number.

Parameters:
version -
Method Detail

addChannel

public void addChannel(churchillobjects.rss4j.RssChannel channel)
Adds a channel to the document.

Parameters:
channel -

channels

public java.util.Enumeration channels()
Returns an enumeration of channels to the document.

Returns:

setVersion

public void setVersion(java.lang.String s)
Sets the RSS version number of the document.

Parameters:
s -

getVersion

public java.lang.String getVersion()
Returns the RSS version number of the document.

Returns:

addWarning

public void addWarning(java.lang.String s)
Adds a warning to the document. This is intended to be used by the parser to communicate problems and inconsistencies with the RSS document,

Parameters:
s -

warnings

public java.util.Enumeration warnings()
Returns an enumeration of the current warnings.

Returns:

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:

hashCode

public int hashCode()
Computes the hashcode of this object based on the hashcodes of the objects it contains. Documents with identical contents but different versions will have different hashcodes.

Overrides:
hashCode in class java.lang.Object
Returns:
The object's hashcode

equals

public boolean equals(java.lang.Object obj)
Canonical equals method. Two RssChannel objects will be equal if their hashcodes (and thus their contents) are equal.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other object
Returns:
If the two objects are canonically equal

clone

public java.lang.Object clone()
Public clone method to allow cloning.

Overrides:
clone in class java.lang.Object
Returns:
This object's clone

Copyright (c) 2000-2002 ChurchillObjects.com