public enum LineSeparator extends java.lang.Enum<LineSeparator>
Identifies a line separator:
either Unix (\n
), Windows (@{code \r\n}) or (possible not actual anymore) Classic Mac (\r
).
The intention is to use this class everywhere, where a line separator is needed, instead of just Strings.
Modifier and Type | Method and Description |
---|---|
static LineSeparator |
fromString(java.lang.String string) |
byte [] |
getSeparatorBytes() |
java.lang.String |
getSeparatorString() |
static LineSeparator |
getSystemLineSeparator() |
static LineSeparator |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static LineSeparator[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LineSeparator LF
public static final LineSeparator CRLF
public static final LineSeparator CR
public static LineSeparator[] values()
for (LineSeparator c : LineSeparator.values()) System.out.println(c);
public static LineSeparator valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static LineSeparator fromString(java.lang.String string)
public java.lang.String getSeparatorString()
public byte [] getSeparatorBytes()
public static LineSeparator getSystemLineSeparator()