com.xinapse.multisliceimage
Enum ComplexMode

java.lang.Object
  extended by java.lang.Enum<ComplexMode>
      extended by com.xinapse.multisliceimage.ComplexMode
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<ComplexMode>

public enum ComplexMode
extends java.lang.Enum<ComplexMode>

An enumeration of the possible display/calculation modes for complex numbers.


Enum Constant Summary
IMAGINARY
          Selects the imaginary part of a complex number.
MAGNITUDE
          Selects the magnitude of a complex number.
PHASE
          Selects the phase of a complex number.
REAL
          Selects the real part of a complex number.
 
Field Summary
static ComplexMode DEFAULT_COMPLEX_MODE
          The default ComplexMode for applications.
 
Method Summary
static ComplexMode getInstance(java.lang.String modeString)
          Returns the ComplexMode corresponding to the supplied String argument.
static ComplexMode getPreferredMode(java.util.prefs.Preferences prefs)
          Returns the ComplexMode set in the supplied Preferences, or the default ComplexMode.
static void savePreferences(ComplexMode mode, java.util.prefs.Preferences prefs)
          Saves the supplied ComplexMode to the user's Preferences as the user's preferred ComplexMode.
 java.lang.String toString()
          Returns a java.lang.String describing this ComplexMode.
static ComplexMode valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static ComplexMode[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

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 Detail

DEFAULT_COMPLEX_MODE

public static final ComplexMode DEFAULT_COMPLEX_MODE
The default ComplexMode for applications.

Method Detail

values

public static ComplexMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ComplexMode c : ComplexMode.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ComplexMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

getPreferredMode

public static ComplexMode getPreferredMode(java.util.prefs.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,
                                   java.util.prefs.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.

getInstance

public static ComplexMode getInstance(java.lang.String modeString)
                               throws java.lang.IllegalArgumentException
Returns the ComplexMode corresponding to the supplied String argument.

Parameters:
modeString - a java.lang.String describing the ComplexMode. One of:
  • "Real"
  • "Imaginary"
  • "Magnitude"
  • "Phase"
The case of the argument is ignored.
Throws:
java.lang.IllegalArgumentException - if the modeString is invalid.

toString

public java.lang.String toString()
Returns a java.lang.String describing this ComplexMode.

Overrides:
toString in class java.lang.Enum<ComplexMode>
Returns:
a java.lang.String describing this ComplexMode.


Copyright 2006-2011 Xinapse Systems Limited. All Rights Reserved.