Package repast.simphony.integration
Enum Class NewLinePatternConverter
- All Implemented Interfaces:
Serializable
,Comparable<NewLinePatternConverter>
,java.lang.constant.Constable
Handles converting newline patterns into different newline patterns. This means it will convert
patterns matching "\n" to a pattern that matches Windows newlines "\r\n", unix newlines "\n",
system dependent (currently only windows or unix types), or do no conversion.
This is NOT for doing "\n" -> "\r\n" type conversions, but is for converting regular
expressions that match newline characters from matching "\n" to matching some other type.
- Author:
- Jerry Vos
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionPerforms no conversionIf the system's line separator is "\r\n" it will do the same as a WINDOWS converter, if the pattern is "\n" it will return a UNIX one, otherwise it will just return the string.Returns the string as it is.Replaces "\n" matches with "\r\n" matches. -
Method Summary
Modifier and TypeMethodDescriptionabstract String
Converts the newline patterns to those specified by its type.static NewLinePatternConverter
getNewLineConverter
(String handleType) Returns the converter that has the specified type as it type.getType()
static NewLinePatternConverter
Returns the enum constant of this class with the specified name.static NewLinePatternConverter[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
NONE
Performs no conversion -
SYSTEM
If the system's line separator is "\r\n" it will do the same as a WINDOWS converter, if the pattern is "\n" it will return a UNIX one, otherwise it will just return the string. -
WINDOWS
Replaces "\n" matches with "\r\n" matches. -
UNIX
Returns the string as it is. This does NOT convert "\r\n" matchers to "\n".
-
-
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
-
getNewLineConverter
Returns the converter that has the specified type as it type.- Parameters:
handleType
- the type to find a converter for.- Returns:
- a NewLinePatternConverter or NewLinePatternConverter.NONE if no matching one can be found
-
getType
-
convert
Converts the newline patterns to those specified by its type.- Parameters:
string
- a string with newline matching patterns- Returns:
- a converted string
-