Enum Class LineDelimiter
- All Implemented Interfaces:
Serializable, Comparable<LineDelimiter>, Constable
Enumeration for different line delimiters (LF, CR, CRLF, platform default).
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCarriage Return - (Mac classic).Carriage Return and Line Feed (Windows).Line Feed - (UNIX).Use current platform default (System.lineSeparator(). -
Method Summary
Modifier and TypeMethodDescriptionstatic LineDelimiterMaps a line delimiter string to the corresponding enum constant.toString()static LineDelimiterReturns the enum constant of this class with the specified name.static LineDelimiter[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LF
Line Feed - (UNIX). -
CR
Carriage Return - (Mac classic). -
CRLF
Carriage Return and Line Feed (Windows). -
PLATFORM
Use current platform default (System.lineSeparator().
-
-
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
-
of
Maps a line delimiter string to the corresponding enum constant.
Accepted values are
"\r\n"(CRLF),"\n"(LF) and"\r"(CR). ThePLATFORMconstant is never returned by this method.- Parameters:
str- the line delimiter string to look up.- Returns:
- the matching enum constant.
- Throws:
IllegalArgumentException- if the string is not a known line delimiter.
-
toString
- Overrides:
toStringin classEnum<LineDelimiter>
-