src/share/classes/javax/print/attribute/EnumSyntax.java

Print this page




  85  * supplied by the enumeration class.
  86  * <P>
  87  * Under the hood, an enumeration value is just an integer, a different integer
  88  * for each enumeration value within an enumeration class. You can get an
  89  * enumeration value's integer value by calling {@link #getValue()
  90  * getValue()}. An enumeration value's integer value is established
  91  * when it is constructed (see {@link #EnumSyntax(int)
  92  * EnumSyntax(int)}). Since the constructor is protected, the only
  93  * possible enumeration values are the singleton objects declared in the
  94  * enumeration class; additional enumeration values cannot be created at run
  95  * time.
  96  * <P>
  97  * You can define a subclass of an enumeration class that extends it with
  98  * additional enumeration values. The subclass's enumeration values' integer
  99  * values need not be distinct from the superclass's enumeration values' integer
 100  * values; the <CODE>==</CODE>, <CODE>!=</CODE>, <CODE>equals()</CODE>, and
 101  * <CODE>toString()</CODE> methods will still work properly even if the subclass
 102  * uses some of the same integer values as the superclass. However, the
 103  * application in which the enumeration class and subclass are used may need to
 104  * have distinct integer values in the superclass and subclass.
 105  * <P>
 106  *
 107  * @author  David Mendenhall
 108  * @author  Alan Kaminsky
 109  */
 110 public abstract class EnumSyntax implements Serializable, Cloneable {
 111 
 112     private static final long serialVersionUID = -2739521845085831642L;
 113 
 114     /**
 115      * This enumeration value's integer value.
 116      * @serial
 117      */
 118     private int value;
 119 
 120     /**
 121      * Construct a new enumeration value with the given integer value.
 122      *
 123      * @param  value  Integer value.
 124      */
 125     protected EnumSyntax(int value) {




  85  * supplied by the enumeration class.
  86  * <P>
  87  * Under the hood, an enumeration value is just an integer, a different integer
  88  * for each enumeration value within an enumeration class. You can get an
  89  * enumeration value's integer value by calling {@link #getValue()
  90  * getValue()}. An enumeration value's integer value is established
  91  * when it is constructed (see {@link #EnumSyntax(int)
  92  * EnumSyntax(int)}). Since the constructor is protected, the only
  93  * possible enumeration values are the singleton objects declared in the
  94  * enumeration class; additional enumeration values cannot be created at run
  95  * time.
  96  * <P>
  97  * You can define a subclass of an enumeration class that extends it with
  98  * additional enumeration values. The subclass's enumeration values' integer
  99  * values need not be distinct from the superclass's enumeration values' integer
 100  * values; the <CODE>==</CODE>, <CODE>!=</CODE>, <CODE>equals()</CODE>, and
 101  * <CODE>toString()</CODE> methods will still work properly even if the subclass
 102  * uses some of the same integer values as the superclass. However, the
 103  * application in which the enumeration class and subclass are used may need to
 104  * have distinct integer values in the superclass and subclass.

 105  *
 106  * @author  David Mendenhall
 107  * @author  Alan Kaminsky
 108  */
 109 public abstract class EnumSyntax implements Serializable, Cloneable {
 110 
 111     private static final long serialVersionUID = -2739521845085831642L;
 112 
 113     /**
 114      * This enumeration value's integer value.
 115      * @serial
 116      */
 117     private int value;
 118 
 119     /**
 120      * Construct a new enumeration value with the given integer value.
 121      *
 122      * @param  value  Integer value.
 123      */
 124     protected EnumSyntax(int value) {