在以下代碼獲取ArrayList值?
queryCmisAdvance.getAdvanceKeywords()
類AdvancePropertyKeywords
在類AdvancePropertyKeywords的返回的ArrayList
有三個參數String Property Name , condition and value.
一些時間是可能的值可以是「」(這是不爲空)
現在我想檢索屬性N ame的價值不是「」。
我的代碼
for(AdvancePropertyKeywords apk : queryCmisAdvance.getAdvanceKeywords()){
if (apk.getValue()!="") {
System.out.println(apk.getPropertyName() +" " +apk.getCondition() + " "+apk.getValue());
}
}
輸出
From =
SentOn > Wed Aug 22 12:00:00 UTC+2 2012
EmailSubject LIKE folder
DocumentTitle NULL rgftre
CarbonCopy LIKE
From value is ""
SentOn value is Wed Aug 22 12:00:00 UTC+2 2012
EmailSubject value is folder
DocumentTitle value is rgftre
CarbonCopy value is ""
什麼問題? – 2012-08-09 11:22:23
不要將字符串與「!=」進行比較。使用.equals()。請參閱http://stackoverflow.com/questions/767372/java-string-equals-versus。 – 2012-08-09 11:22:54