Package com.xinapse.image
Enum Class ComplexMode
- All Implemented Interfaces:
Serializable
,Comparable<ComplexMode>
,Constable
An enumeration of the possible display/calculation modes for complex numbers.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final ComplexMode
The defaultComplexMode
for applications. -
Method Summary
Modifier and TypeMethodDescriptionstatic ComplexMode
getInstance
(String modeString) Returns theComplexMode
corresponding to the suppliedString
argument.static ComplexMode
getPreferredMode
(Preferences prefs) Returns theComplexMode
set in the supplied Preferences, or the default ComplexMode.static void
savePreferences
(ComplexMode mode, Preferences prefs) Saves the suppliedComplexMode
to the user's Preferences as the user's preferredComplexMode
.toString()
Returns aString
describing this ComplexMode.static ComplexMode
Returns the enum constant of this class with the specified name.static ComplexMode[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
REAL
Selects the real part of a complex number. -
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.
-
-
Field Details
-
DEFAULT_COMPLEX_MODE
The defaultComplexMode
for applications.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
getPreferredMode
Returns theComplexMode
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
Saves the suppliedComplexMode
to the user's Preferences as the user's preferredComplexMode
.- Parameters:
mode
- theComplexMode
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
Returns theComplexMode
corresponding to the suppliedString
argument.- Parameters:
modeString
- aString
describing theComplexMode
. One of:- "Real"
- "Imaginary"
- "Magnitude"
- "Phase"
- Returns:
- a
ComplexMode
according to the suppliedString
. - Throws:
IllegalArgumentException
- if themodeString
is invalid.
-
toString
Returns aString
describing this ComplexMode.- Overrides:
toString
in classEnum<ComplexMode>
- Returns:
- a
String
describing this ComplexMode.
-