当前位置: 首页>>代码示例>>Java>>正文


Java Item.setDescription方法代码示例

本文整理汇总了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;
}
 
开发者ID:socialsensor,项目名称:socialsensor-framework-client,代码行数:13,代码来源:SolrNewsFeed.java

示例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;
}
 
开发者ID:socialsensor,项目名称:socialsensor-framework-client,代码行数:46,代码来源:SolrItemHandler.java

示例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;
    }
 
开发者ID:socialsensor,项目名称:socialsensor-framework-client,代码行数:74,代码来源:SolrItem.java


注:本文中的eu.socialsensor.framework.common.domain.Item.setDescription方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。