int newssize = heraldNews.size();
if(newssize==0){
npc.say("My announcements list is empty.");
return;
}
StringBuilder sb=new StringBuilder();
sb.append("Here " + Grammar.isare(newssize) + " my current " + Grammar.plnoun(newssize,"announcement") + ": ");
for(int i=0; i<newssize;i++){
// will add 1 to position numbers to show position 0 as 1.
logger.info("info: index "+Integer.toString(i));
try {
final int left = heraldNews.get(i).getLimit()/heraldNews.get(i).getInterval()-
heraldNews.get(i).getCounter();
sb.append(" #"+Integer.toString(i+1)+". (left "+
Integer.toString(left)+" times): "+
"#Every #"+Integer.toString(heraldNews.get(i).getInterval())+
" #seconds #to #"+Integer.toString(heraldNews.get(i).getLimit())+
" #seconds: \""+heraldNews.get(i).getNews()+"\"");
} catch (IndexOutOfBoundsException ioobe) {
logger.error("ReadNewsAction: size of heraldNews = "+
Integer.toString(newssize), ioobe);
}
if(i!=(newssize-1)){
sb.append("; ");
}
}
npc.say(sb.toString());
}