com.horstmann.violet.framework
Class SerializableEnumeration

java.lang.Object
  extended by com.horstmann.violet.framework.SerializableEnumeration
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ArrowHead, BentStyle, LineStyle

public class SerializableEnumeration
extends java.lang.Object
implements java.io.Serializable

This class is a superclass for enumerated types that can be serialized. Subclass like this:

   public class MyEnumeration extends SerializableEnumeration
   {
      private MyEnumeration() {}
      public static final MyEnumeration FOO = new MyEnumeration();
      public static final MyEnumeration BAR = new MyEnumeration();
      . . .
   }
   
This defines instances MyEnumeration.FOO and MyEnumeration.BAR that are guaranteed to be preserved through serialization and deserialization. Conveniently, the toString method yields the name (such as "FOO").

See Also:
Serialized Form

Constructor Summary
SerializableEnumeration()
           
 
Method Summary
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SerializableEnumeration

public SerializableEnumeration()
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object