com.sun.syndication.fetcher.impl
Class SyndFeedInfo

java.lang.Object
  extended bycom.sun.syndication.fetcher.impl.SyndFeedInfo
All Implemented Interfaces:
Cloneable, Comparable, Serializable

public class SyndFeedInfo
extends Object
implements Cloneable, Comparable, Serializable

A class to represent a SyndFeed and some useful information about it.

Author:
Nick Lothian
See Also:
Serialized Form

Field Summary
private  ObjectBean _objBean
           
private  String eTag
           
private  String id
           
private  Object lastModified
           
static long serialVersionUID
           
private  SyndFeed syndFeed
           
private  URL url
           
 
Constructor Summary
SyndFeedInfo()
           
 
Method Summary
 Object clone()
          Creates a deep 'bean' clone of the object.
 int compareTo(Object obj)
           Compares this object with the specified object for order.
 boolean equals(Object other)
          Indicates whether some other object is "equal to" this one as defined by the Object equals() method.
 String getETag()
           
 String getId()
           
 Object getLastModified()
           
 SyndFeed getSyndFeed()
           
 URL getUrl()
           
 int hashCode()
          Returns a hashcode value for the object.
private  void readObject(ObjectInputStream in)
           Deserializes this SyndFeedInfo object.
 void setETag(String string)
           
 void setId(String string)
           
 void setLastModified(Object o)
           
 void setSyndFeed(SyndFeed feed)
           
 void setUrl(URL url)
           
 String toString()
          Returns the String representation for the object.
private  void writeObject(ObjectOutputStream out)
           Serializes this SyndFeedInfo object.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

public static final long serialVersionUID
See Also:
Constant Field Values

_objBean

private ObjectBean _objBean

id

private String id

url

private URL url

lastModified

private Object lastModified

eTag

private String eTag

syndFeed

private SyndFeed syndFeed
Constructor Detail

SyndFeedInfo

public SyndFeedInfo()
Method Detail

clone

public Object clone()
             throws CloneNotSupportedException
Creates a deep 'bean' clone of the object.

Returns:
a clone of the object.
Throws:
CloneNotSupportedException - thrown if an element of the object cannot be cloned.

equals

public boolean equals(Object other)
Indicates whether some other object is "equal to" this one as defined by the Object equals() method.

Parameters:
other - he reference object with which to compare.
Returns:
true if 'this' object is equal to the 'other' object.

hashCode

public int hashCode()
Returns a hashcode value for the object.

It follows the contract defined by the Object hashCode() method.

Returns:
the hashcode of the bean object.

toString

public String toString()
Returns the String representation for the object.

Returns:
String representation for the object.

getETag

public String getETag()
Returns:
the ETag the feed was last retrieved with

getLastModified

public Object getLastModified()
Returns:
the last modified date for the feed

getUrl

public URL getUrl()
Returns:
the URL the feed was served from

setETag

public void setETag(String string)

setLastModified

public void setLastModified(Object o)

setUrl

public void setUrl(URL url)

getSyndFeed

public SyndFeed getSyndFeed()

setSyndFeed

public void setSyndFeed(SyndFeed feed)

getId

public String getId()
Returns:
A unique ID to identify the feed

setId

public void setId(String string)
Parameters:
string - A unique ID to identify the feed. Note that if the URL of the feed changes this will remain the same

compareTo

public int compareTo(Object obj)

Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.

The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.

Finally, the implementer must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.

It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."

Specified by:
compareTo in interface Comparable
Parameters:
obj - the Object to be compared
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object

writeObject

private void writeObject(ObjectOutputStream out)
                  throws IOException

Serializes this SyndFeedInfo object. The enclosed SyndFeed is serialized as separate xml file into the default ConfigurationManager.DEFAULT_CACHE_DIRECTORY_KEY using the getId() plus the .xml suffix as filename.

Parameters:
out - the ObjectOutputStream to be used for serialization
Throws:
IOException - if an io error occurred during serialization

readObject

private void readObject(ObjectInputStream in)
                 throws IOException,
                        ClassNotFoundException

Deserializes this SyndFeedInfo object. The enclosed SyndFeed is deserialized from a separate xml file in the default ConfigurationManager.DEFAULT_CACHE_DIRECTORY_KEY denoted by getId() plus the .xml suffix.

Parameters:
in - the ObjectInputStream to be used for deserialization
Throws:
IOException - if an io error occurred during serialization
ClassNotFoundException