Package net.sf.okapi.filters.openxml
Enum Color
- java.lang.Object
-
- java.lang.Enum<Color>
-
- net.sf.okapi.filters.openxml.Color
-
- All Implemented Interfaces:
Serializable,Comparable<Color>
public enum Color extends Enum<Color>
Represents a color with its name and available codes.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLUEDARK_BLUEDARK_REDGREENLIGHT_BLUELIGHT_GREENORANGEPURPLEREDYELLOW
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ColorfromCode(String code)Get a color based on its color code (either Word or Excel).static ColorfromName(String name)Get a color based on its name.StringgetExcelColorCode()Get the color's Excel Color Code.StringgetName()Get the color's name.StringgetWordColorCode()Get the color's Word Color Code.static ColorvalueOf(String name)Returns the enum constant of this type with the specified name.static Color[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BLUE
public static final Color BLUE
-
LIGHT_BLUE
public static final Color LIGHT_BLUE
-
GREEN
public static final Color GREEN
-
PURPLE
public static final Color PURPLE
-
RED
public static final Color RED
-
YELLOW
public static final Color YELLOW
-
DARK_RED
public static final Color DARK_RED
-
LIGHT_GREEN
public static final Color LIGHT_GREEN
-
ORANGE
public static final Color ORANGE
-
DARK_BLUE
public static final Color DARK_BLUE
-
-
Method Detail
-
values
public static Color[] 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 (Color c : Color.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static Color 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
-
fromName
public static Color fromName(String name)
Get a color based on its name.- Parameters:
name- the name to find.- Returns:
- the
Colorsor null if not found.
-
fromCode
public static Color fromCode(String code)
Get a color based on its color code (either Word or Excel).- Parameters:
code- the code to find.- Returns:
- the
Colorsor null if not found.
-
getName
public String getName()
Get the color's name.- Returns:
- the name.
-
getExcelColorCode
public String getExcelColorCode()
Get the color's Excel Color Code.- Returns:
- the Excel color code.
-
getWordColorCode
public String getWordColorCode()
Get the color's Word Color Code.- Returns:
- the Excel color code.
-
-