- All Implemented Interfaces:
Serializable,Comparable<OutputFileFormat>,Constable
Enum for some output files. These files are usually taken as an input for
some electromagnetic field calculation software like Opera or COMSOL, etc. as
input file to get out the field values at the specified points.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgetOpera3DHeader(int nPoints, LengthUnit lengthUnit) Gets a header specific for use of a file in Opera3D.static OutputFileFormatParses the string to the correct enum.static StringstripOpera3DHeader(String content) Strips the Opera3D header from a full Opera table file content and returns only the table data (everything after the header).static OutputFileFormatReturns the enum constant of this class with the specified name.static OutputFileFormat[]values()Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Enum Constant Details
-
PLAINTEXT
An enum to categorize a plaintext file. -
OPERA3D
An enum to categorize an Opera3D file.
-
-
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
-
getOpera3DHeader
Gets a header specific for use of a file in Opera3D.- Parameters:
nPoints- The number of points.lengthUnit- The length unit.- Returns:
- The generated header as a String.
-
stripOpera3DHeader
Strips the Opera3D header from a full Opera table file content and returns only the table data (everything after the header). The Opera3D header used by this project ends with a line that contains a single zero ("0"). This method finds the first line that is exactly "0" (ignoring surrounding whitespace) and returns the substring of the original content that follows that line, preserving all remaining characters and line separators unchanged. If the input is null, null is returned. If no terminating "0" line is found, the original content is returned unchanged.- Parameters:
content- full file content of an Opera3D table file- Returns:
- the table data portion (content after the Opera header) or the original content when the header cannot be identified
-
parse
Parses the string to the correct enum.- Parameters:
s- string version of the output format- Returns:
- the enum for the output format
-