Enum Class ComplexMode

java.lang.Object
java.lang.Enum<ComplexMode>
com.xinapse.image.ComplexMode
All Implemented Interfaces:
Serializable, Comparable<ComplexMode>, Constable

public enum ComplexMode extends Enum<ComplexMode>
An enumeration of the possible display/calculation modes for complex numbers.
  • Enum Constant Details

    • REAL

      public static final ComplexMode REAL
      Selects the real part of a complex number.
    • IMAGINARY

      public static final ComplexMode IMAGINARY
      Selects the imaginary part of a complex number.
    • MAGNITUDE

      public static final ComplexMode MAGNITUDE
      Selects the magnitude of a complex number.
    • PHASE

      public static final ComplexMode PHASE
      Selects the phase of a complex number.
  • Field Details

    • DEFAULT_COMPLEX_MODE

      public static final ComplexMode DEFAULT_COMPLEX_MODE
      The default ComplexMode for applications.
  • Method Details

    • values

      public static ComplexMode[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static ComplexMode valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getPreferredMode

      public static ComplexMode getPreferredMode(Preferences prefs)
      Returns the ComplexMode set in the supplied Preferences, or the default ComplexMode.
      Parameters:
      prefs - the Preferences from which the ComplexMode is to be retrieved.
      Returns:
      the ComplexMode gotten from the user's preferences, or the default if not set in the user's Preferences.
    • savePreferences

      public static void savePreferences(ComplexMode mode, Preferences prefs)
      Saves the supplied ComplexMode to the user's Preferences as the user's preferred ComplexMode.
      Parameters:
      mode - the ComplexMode that the user most often works with, and which will be set as the default to use when this Class loads.
      prefs - the user Preferences.
    • getInstance

      public static ComplexMode getInstance(String modeString) throws IllegalArgumentException
      Returns the ComplexMode corresponding to the supplied String argument.
      Parameters:
      modeString - a String describing the ComplexMode. One of:
      • "Real"
      • "Imaginary"
      • "Magnitude"
      • "Phase"
      The case of the argument is ignored.
      Returns:
      a ComplexMode according to the supplied String.
      Throws:
      IllegalArgumentException - if the modeString is invalid.
    • toString

      public String toString()
      Returns a String describing this ComplexMode.
      Overrides:
      toString in class Enum<ComplexMode>
      Returns:
      a String describing this ComplexMode.