简体   繁体   中英

How do I retrieve the data from a kx.Flip object into a more readable form in Java?

I tried several ways but was unsuccessful. The Flip object I get from the KDB database is in a form like "com.kx.Flip@vhv98765". I need to obtain the data in a array or list. The Flip data should ideally contain rows and columns. I think using getColumnValues() might be a hint. But I am struggling to actually decode the flip data.

Need extract Flip data into table. Any code or ideas are very appreciated.

If you haven't already, have a look at the Java documentation on the official site: https://code.kx.com/q/interfaces/

This one in particular seems to show an example of extracting data from a flip class: https://code.kx.com/q/interfaces/java-client-for-q/

c.Flip flip=(c.Flip)c.k("([]sym:`MSFT`GOOG;time:0 1+.z.n;price:320.2 120.1;size:100 300)");
for(int col=0;col<flip.x.length;col++)
  System.out.print((col>0?",":"")+flip.x[col]);
System.out.println();
for(int row=0;row<n(flip.y[0]);row++){
  for(int col=0;col<flip.x.length;col++)
    System.out.print((col>0?",":"")+c.at(flip.y[col],row));
    System.out.println();
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM