Package de.labathome
Class FortranNamelist
java.lang.Object
de.labathome.FortranNamelist
Class to parse Fortran namelists into Java classes.
This uses the information given in the class definition to constrain the parser.
- Version:
- 0.9.0 2018-07-25 intial implementation, 1.0.1 2018-09-11 1d and 2d arrays with fancy specifiers
- Author:
- Jonathan Schilling (jonathan.schilling@mail.de)
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanset to true to be enable verbal diarrhea with lots of debug output -
Constructor Summary
ConstructorsConstructorDescriptionFortranNamelist(String _namelist, String _groupName, Object _parseInto) Define parser for groupgroupNamefrom the namelist given as text innamelistaccording to the Object definition given asparseInto. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallowedArrayIndex(int minIdx, int maxIdx, int idxToCheck, String varname) Check index boundaries for inserting values into array; named version.Call the parser and return the parsed Object.
-
Field Details
-
_debug
public boolean _debugset to true to be enable verbal diarrhea with lots of debug output
-
-
Constructor Details
-
FortranNamelist
Define parser for groupgroupNamefrom the namelist given as text innamelistaccording to the Object definition given asparseInto.- Parameters:
_namelist- String containing the namelist_groupName- group name of the group to be parsed into the objectparseInto_parseInto- Object definition for parsing target. Use annotationnamelist_variable(name="lstell_sym")to specify which variables to parse.nameis optional (default=take variable name as identifier in namelist) and can be used to map from Fortran names (e.g. lstell_sym) to your own defitions (e.g. stellaratorSymmetric).
-
-
Method Details
-
getParsed
Call the parser and return the parsed Object.- Returns:
- Object of same type as
parseIntowith member variables filled out as stated in namelist.
-
allowedArrayIndex
Check index boundaries for inserting values into array; named version.- Parameters:
minIdx- minimum allowable index, i.e. 0 for int[] a = int[10];maxIdx- maximum allowable index, i.e. 9 for int[] a = int[10];idxToCheck- index to check, i.e. 5 or 11varname- name of variable to be included in error message for debugging- Returns:
- true: idxToCheck within bounds (i.e. for idxToCheck=5); false if not (i.e. for idxToCheck=11)
-