Enum Type
- java.lang.Object
-
- java.lang.Enum<Type>
-
- adams.gui.visualization.core.axis.Type
-
- All Implemented Interfaces:
EnumWithCustomDisplay<Type>
,EnumWithCustomParsing<Type>
,Serializable
,Comparable<Type>
public enum Type extends Enum<Type> implements EnumWithCustomDisplay<Type>
Enumeration for the type of axis.- Author:
- fracpete (fracpete at waikato dot ac dot nz)
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DATE
displaying dates.DATETIME
displaying date/times.DATETIMEMSEC
displaying date/times.DEFAULT
displaying absolute values (default).LOG
displaying ln values.PERCENTAGE
displaying percentage values.TIME
displaying times.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canHandle(double min, double max)
Checks whether the data range can be handled by the model.AbstractAxisModel
getModel()
Returns the corresponding axis model.Type
parse(String s)
Returns the corresponding type.String
toDisplay()
Returns the display string, used in toString().String
toRaw()
Returns the raw enum string.String
toString()
Returns the display string.static String
toString(AbstractOption option, Object object)
Returns the enum as string.static Type
valueOf(AbstractOption option, String str)
Returns an enum generated from the string.static Type
valueOf(String name)
Returns the enum constant of this type with the specified name.static Type[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT
public static final Type DEFAULT
displaying absolute values (default).
-
PERCENTAGE
public static final Type PERCENTAGE
displaying percentage values.
-
LOG
public static final Type LOG
displaying ln values.
-
DATE
public static final Type DATE
displaying dates.
-
TIME
public static final Type TIME
displaying times.
-
DATETIME
public static final Type DATETIME
displaying date/times.
-
DATETIMEMSEC
public static final Type DATETIMEMSEC
displaying date/times.
-
-
Method Detail
-
values
public static Type[] 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 (Type c : Type.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Type valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
toDisplay
public String toDisplay()
Returns the display string, used in toString().- Specified by:
toDisplay
in interfaceEnumWithCustomDisplay<Type>
- Returns:
- the display string
- See Also:
toString()
-
toRaw
public String toRaw()
Returns the raw enum string.- Specified by:
toRaw
in interfaceEnumWithCustomDisplay<Type>
- Returns:
- the raw enum string
-
getModel
public AbstractAxisModel getModel()
Returns the corresponding axis model.- Returns:
- the model
-
canHandle
public boolean canHandle(double min, double max)
Checks whether the data range can be handled by the model.- Parameters:
min
- the minimum valuemax
- the maximum value- Returns:
- true if the data can be handled
-
toString
public String toString()
Returns the display string.
-
parse
public Type parse(String s)
Returns the corresponding type. First tries to parse using the valueOf method of the Enum class, then going over all the enums and checking the display string.- Specified by:
parse
in interfaceEnumWithCustomParsing<Type>
- Parameters:
s
- the string to parse- Returns:
- the corresponding type or null if not found
-
toString
public static String toString(AbstractOption option, Object object)
Returns the enum as string.- Parameters:
option
- the current optionobject
- the enum object to convert- Returns:
- the generated string
-
valueOf
public static Type valueOf(AbstractOption option, String str)
Returns an enum generated from the string.- Parameters:
option
- the current optionstr
- the string to convert to an enum- Returns:
- the generated enum or null in case of error
-
-