com.sun.syndication.common
Class Enum

java.lang.Object
  extended bycom.sun.syndication.common.Enum
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable
Direct Known Subclasses:
Channel.Day, Content.Mode, Link.Rel, SyModule.Period

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

Base class for enumerations (to bad is too early for Java 1.5).

Enum objects are inmutable.

Author:
Alejandro Abdelnur
See Also:
Serialized Form

Constructor Summary
protected Enum(java.lang.String name)
          Creates an Enum object with the given name.
 
Method Summary
 java.lang.Object clone()
          Clones the Enum.
 boolean equals(java.lang.Object obj)
          Indicates whether some other Enum is "equal to" this one as defined by the Object equals() method.
 int hashCode()
          Returns a hashcode value for the Enum.
 java.lang.String toString()
          Returns the String representation of the Enum.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Enum

protected Enum(java.lang.String name)
Creates an Enum object with the given name.

Parameters:
name - of the Enum.
Method Detail

toString

public java.lang.String toString()
Returns the String representation of the Enum.

Returns:
the Enum String representation.

clone

public java.lang.Object clone()
Clones the Enum.

Returns:
a clone of the Enum object, as Enum objects are inmutable, it returns the same object.

equals

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

Parameters:
obj - the object to compare with.
Returns:
true if 'this' object is equal to the 'obj' object.

hashCode

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

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

Returns:
the hashcode of the Enum object.


Copyright © 2004 Sun Microsystems. All Rights Reserved.