Enum Class

Methods | This Package | All Packages

Represents the base enumerator class.

package com.ms.wfc.core

public class Enum

Remarks

Extend this class for the Properties window to recognize your constants. To create your own enumerator class, declare the public static final integers and override the valid method. To associate a property with your enumerator, specify that the property has the enumerator type in the ClassInfo inner class. (Because the enumerator types are integers, the actual type of the property in the method declarations should be an int.) The Properties window will display a drop-down list with the enumerator values.

The following code shows a simple example:

// Define an enumerator class.
class Alignment extends Enum {

   public static final int NONE = 0;
   public static final int LEFT = 1;
   public static final int CENTER = 2;
   public static final int RIGHT = 3;

   public static boolean valid(int value) {
      if (value < 0 || value > 3) return false;
        return true;
   }
}

// Set the alignment property of an object.
myObject.setAlignment(Alignment.LEFT);