public class Cif2DataParser
extends javajs.util.CifDataParser
| Constructor and Description |
|---|
Cif2DataParser() |
| Modifier and Type | Method and Description |
|---|---|
private java.lang.String |
fixLineFolding(java.lang.String str)
allow white space between \ and \n
|
static double[] |
getArrayFromStringList(java.lang.String s,
int n)
turn "[1,2,3]" into [1.0,2.0,3.0]
array will be truncated to n elements, or filled with zeros to pad to n, as necessary.
|
protected java.lang.Object |
getQuotedStringOrObject(char ch)
final get for quoted object
|
protected int |
getVersion() |
protected boolean |
isQuote(char ch)
Includes all possible operator tokens
|
private boolean |
isSpaceOrColon(int ich)
used by readTable
|
protected java.lang.String |
preprocessString()
initial processing; returns a string bounded by \1
|
private java.lang.Object |
processQuotedString()
Handle all forms of quotation,
including '...', "...", '''...''', """...""", and ;...\n...\n;
|
protected java.lang.String |
processSemiString()
Sets a multiline semicolon-eclipsed string to be parsed from the beginning,
allowing for CIF 2.0-type prefixed text lines and removing line folding.
|
java.lang.Object |
readList()
Read a CIF 2.0 list structure, converting it to either a JSON string or to
a Java data structure
|
java.lang.Object |
readTable()
Read a CIF 2.0 table into either a JSON string
or a java data structure
|
java.lang.String |
toUnicode(java.lang.String data)
There is no need to convert to unicode in CIF 2.0.
|
protected java.lang.Object |
unquoted(java.lang.String s)
Handle unquoted value as Integer or Float if we can.
|
fixKey, fullTrim, getAllCifData, getColumnCount, getColumnData, getColumnName, getData, getFileHeader, getNextDataToken, getNextToken, getNextTokenObject, getNextTokenProtected, getTokenPeeked, isTerminator, parseDataBlockParameters, peekToken, prepareNextLine, preprocessSemiString, readLine, set, setNullValue, setString, skipLoopprotected int getVersion()
getVersion in class javajs.util.CifDataParserpublic java.lang.String toUnicode(java.lang.String data)
toUnicode in interface javajs.api.GenericCifDataParsertoUnicode in class javajs.util.CifDataParserprotected boolean isQuote(char ch)
isQuote in class javajs.util.CifDataParserprotected java.lang.Object getQuotedStringOrObject(char ch)
getQuotedStringOrObject in class javajs.util.CifDataParserch - current character being pointed toprotected java.lang.String preprocessString()
throws java.lang.Exception
preprocessString in class javajs.util.CifDataParserjava.lang.Exceptionprivate java.lang.Object processQuotedString()
protected java.lang.String processSemiString()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Object readList()
throws java.lang.Exception
java.lang.Exceptionpublic java.lang.Object readTable()
throws java.lang.Exception
java.lang.Exceptionprivate boolean isSpaceOrColon(int ich)
ich - buffer pointerprotected java.lang.Object unquoted(java.lang.String s)
unquoted in class javajs.util.CifDataParsers - unquoted stringprivate java.lang.String fixLineFolding(java.lang.String str)
str - already enclosed in \1.....\1public static double[] getArrayFromStringList(java.lang.String s,
int n)
s - n -