Package org.jmol.util
Class Parser
java.lang.Object
org.jmol.util.Parser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringfixDataString(String str) static int[]static intparseFloatArrayBsData(String[] tokens, BS bs, float[] data) static float[]parseFloatArrayFromMatchAndField(String str, BS bs, int fieldMatch, int fieldMatchColumnCount, int[] matchData, int field, int fieldColumnCount, float[] data, int firstLine) the major lifter here.static intparseStringInfestedFloatArray(String str, BS bs, float[] data) parses a "dirty" string for floats.
-
Constructor Details
-
Parser
public Parser()
-
-
Method Details
-
parseStringInfestedFloatArray
parses a "dirty" string for floats. If there are non-float tokens, they are ignored. A bitset is used to assign values only to specific atoms in the set, not changing the values of the data array for other atoms. thus, a data set can be incrementally added to in this way.- Parameters:
str- the string to parsebs- the atom positions to assigndata- the (sparce) array to fill- Returns:
- number of floats
-
parseFloatArrayBsData
-
parseFloatArrayFromMatchAndField
public static float[] parseFloatArrayFromMatchAndField(String str, BS bs, int fieldMatch, int fieldMatchColumnCount, int[] matchData, int field, int fieldColumnCount, float[] data, int firstLine) the major lifter here.- Parameters:
str- string containing the databs- selects specific rows of the datafieldMatch- a free-format field pointer, or a column pointerfieldMatchColumnCount- specifies a column count -- not free-formatmatchData- an array of data to match (atom numbers)field- a free-format field pointer, or a column pointerfieldColumnCount- specifies a column count -- not free-formatdata- float array to modify or null if size unknownfirstLine- first line to parse (1 indicates all)- Returns:
- data
-
fixDataString
-
markLines
-