Метод getContentByTopic (NetNewsBean.java)
Листинг 9.34. Метод getContentByTopic (NetNewsBean.java)
public String getContentByTopic( String content, String fmt ){ if( newsM == null ) return noDataStr ; StringBuffer sb = new StringBuffer(1000);
if( newsM.usable ){ Element[] art = newsM.articlesByTopic( content );
if( art == null ) return dataSourceErr ; for( int i = 0 ; i < art.length ; i++ ){ sb.append( newsM.formatElement( art[i], fmt ));
sb.append("\n");
} } else { sb.append("getContentByTopic " + dataSourceErr );
sb.append("getContentByTopic " + newsM.lastErr );
} return sb.toString();
}
public String toString() { StringBuffer sb = new StringBuffer("NetNewsBean ");
return sb.toString() ; }
}
Содержание раздела