Element クラスのデータがあります。その値をファイルに書き込もうとしていますが、問題があります:
< Some process to acquire values into the variable "fieldData" >
// Prepare file output
FileWriter fstream = new FileWriter("C:/output.txt");
BufferedWriter out = new BufferedWriter(fstream);
Element field = fieldData.getElement(i);
out.write(field); // DOESN'T WORK: The method write(int) in the type BufferedWriter is not applicable for the arguments (Element)
out.write(field.getValueAsString()); // DOESN'T WORK: Cannot convert SEQUENCE to String
このケースをどのように処理すべきかについて何か提案はありますか? また、オブジェクトに関連付けられた使用可能な静的変数とメソッドを確認する (つまり、画面に出力する) 最良の方法は何ですか? どうも。
デバッグに役立つその他のコード スニペット:
private static final Name SECURITY_DATA = new Name("securityData");
private static final Name FIELD_DATA = new Name("fieldData");
Element securityDataArray = msg.getElement(SECURITY_DATA); // msg is a Bloomberg desktop API object
Element securityData = securityDataArray.getValueAsElement(0);
Element fieldData = securityData.getElement(FIELD_DATA);
Element field = fieldData.getElement(0)
out.write(field); // DOESN'T WORK: The method write(int) in the type BufferedWriter is not applicable for the arguments (Element)
out.write(field.getValueAsString()); // DOESN'T WORK: Cannot convert SEQUENCE to String