Defining constants for a Java enum

Procedure

  1. Double-click the relevant enum in the browser to open its Features window.
  2. Select the Enum Values tab.
    Enum window
  3. Click <new> in the list.
  4. Click the Name column to change the default name assigned by IBM® Rational® Rhapsody®.
  5. Click the Value column to define the argument values that will be used to instantiate this instance of the enum (if you are providing more than one argument, separate them with commas).
  6. Optional: Add comments for the constants you have defined.
  7. Click OK.

Results

After they have been defined, enum constants appear underneath the relevant enum in the browser.

Note: Rational Rhapsody does not support the definition of anonymous classes that extend enum constants.

Feedback