在以下代码获取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