本文整理汇总了Java中eu.socialsensor.framework.common.domain.Item.setDescription方法的典型用法代码示例。如果您正苦于以下问题:Java Item.setDescription方法的具体用法?Java Item.setDescription怎么用?Java Item.setDescription使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eu.socialsensor.framework.common.domain.Item
的用法示例。
在下文中一共展示了Item.setDescription方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toItem
import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public Item toItem(){
Item item = new Item();
item.setId(id);
item.setTitle(title);
item.setDescription(description);
item.setPublicationTime(publicationTime);
item.setUrl(source);
item.setList(lists);
return item;
}
示例2: findItemsWithScore
import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public Map<Item, Float> findItemsWithScore(String query) {
Map<Item, Float> itemsByScore = new HashMap<Item, Float>();
SolrQuery solrQuery = new SolrQuery(query);
solrQuery.setFields("id", "title", "description", "publicationTime", "score");
solrQuery.addSortField("score", ORDER.desc);
solrQuery.setRows(100);
QueryResponse rsp = null;
try {
rsp = server.query(solrQuery);
} catch (SolrServerException e) {
e.printStackTrace();
Logger.getRootLogger().info(e.getMessage());
}
List<SolrDocument> retrievedItems = rsp.getResults();
for (SolrDocument sDoc : retrievedItems) {
Float score = (Float) sDoc.getFieldValue("score");
String title = (String) sDoc.getFieldValue("title");
String description = (String) sDoc.getFieldValue("description");
String id = (String) sDoc.getFieldValue("id");
Long publicationTime = (Long) sDoc.getFieldValue("publicationTime");
//System.out.println("Solr Document #"+id);
//System.out.println("Solr Document Title : "+title);
//System.out.println("Solr Document Score : "+description);
//System.out.println("Solr Document Score : "+score);
//System.out.println();
Item item = new Item();
item.setId(id);
item.setTitle(title);
item.setDescription(description);
item.setPublicationTime(publicationTime);
itemsByScore.put(item, score);
}
return itemsByScore;
}
示例3: toItem
import eu.socialsensor.framework.common.domain.Item; //导入方法依赖的package包/类
public Item toItem() throws MalformedURLException {
Item item = new Item();
item.setNumOfComments(popularityComments);
item.setLikes(popularityLikes);
item.setShares(popularityShares);
item.setValidityScore(validityScore);
item.setVotes(ItemFactory.createVoteList(validityVotes));
item.setPositiveVotes(positiveVotes);
item.setNegativeVotes(negativeVotes);
item.setOriginalTitle(originalTitle);
item.setId(id);
item.setStreamId(streamId);
item.setTitle(title);
item.setDescription(description);
item.setTags(tags);
item.setOriginal(original);
item.setUrl(source);
if (links != null) {
URL[] _links = new URL[links.size()];
for (int i = 0; i < links.size(); i++) {
_links[i] = new URL(links.get(i));
}
item.setLinks(_links);
}
item.setPublicationTime(publicationTime);
item.setComments(comments);
if (latitude != null && longitude != null) {
item.setLocation(new Location(latitude, longitude, location));
} else {
item.setLocation(new Location(location));
}
if (mediaIds != null) {
item.setMediaIds(mediaIds);
}
item.setAlethiometerScore(alethiometerScore);
item.setAlethiometerUserScore(alethiometerUserScore);
item.setUserRole(userRole);
item.setAuthorFullName(authorFullName);
item.setFollowersCount(followersCount);
item.setFriendsCount(friendsCount);
item.setAvatarImage(avatarImage);
item.setAvatarImageSmall(avatarImageSmall);
item.setAuthorScreenName(authorScreenName);
item.setLang(language);
if (category != null) {
if (category.equals("politician")) {
item.setCategory(Category.politician);
} else if (category.equals("footballer")) {
item.setCategory(Category.footballer);
} else if (category.equals("official")) {
item.setCategory(Category.official);
} else if (category.equals("journalist")) {
item.setCategory(Category.journalist);
}
}
item.setAlethiometerUserStatus(alethiometerUserStatus);
item.setShares(new Long(retweetsCount));
return item;
}