本文整理汇总了Java中eu.socialsensor.framework.common.domain.Location类的典型用法代码示例。如果您正苦于以下问题:Java Location类的具体用法?Java Location怎么用?Java Location使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Location类属于eu.socialsensor.framework.common.domain包,在下文中一共展示了Location类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeLocation
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
@Override
public void removeLocation(Location location, SocialNetworkSource sourceType) {
String name = location.getName();
if(name != null) {
if(sourceType == SocialNetworkSource.All) {
mongoHandler.delete("name", name);
}
else {
Map<String, Object> map = new HashMap<String, Object>();
map.put("name", name);
map.put("source", sourceType);
mongoHandler.delete(map);
}
}
}
示例2: insertLocation
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
@Override
public void insertLocation(String name, double latitude, double longitude) {
Location location = new Location(latitude, longitude, name);
Map<String, Object> map = location.toJSONMap();
map.put("_id", name);
map.put("timestamp", System.currentTimeMillis());
mongoHandler.update("_id", name, map);
}
示例3: DailyMotionMediaItem
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public DailyMotionMediaItem(DailyMotionVideo video) throws Exception {
super(new URL(video.embed_url));
//id
this.setId("Dailymotion#" + video.id);
//SocialNetwork Name
this.setStreamId("Dailymotion");
//Type
this.setType("video");
//Time of publication
this.setPublicationTime(1000 * video.created_time);
//PageUrl
this.setPageUrl(video.url);
//Thumbnail
this.setThumbnail(video.thumbnail_url);
//Title
this.setTitle(video.title);
//Tags
this.setTags(video.tags);
//Popularity
comments = new Long(video.comments_total);
views = new Long(video.views_total);
ratings = new Float(video.ratings_total);
//Location
double[] geoloc = video.geoloc;
if(geoloc != null && geoloc.length>0) {
Location location = new Location(geoloc[0], geoloc[1]);
this.setLocation(location);
}
}
示例4: LocationFeed
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public LocationFeed(Location location, Date since, String id) {
super(since, Feed.FeedType.LOCATION);
this.location = location;
this.id = id;
}
示例5: getLocation
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public Location getLocation() {
return this.location;
}
示例6: setLocation
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public void setLocation(Location location) {
this.location = location;
}
示例7: getNearLocations
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public List<Location> getNearLocations() {
return nearLocations;
}
示例8: setNearLocations
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public void setNearLocations(List<Location> nearLocations) {
this.nearLocations = nearLocations;
}
示例9: setLocations
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
@Override
public void setLocations(List<Location> locations, SocialNetworkSource sourceType) {
for(Location location : locations) {
locationDAO.insertLocation(location, sourceType);
}
}
示例10: removeLocations
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
@Override
public void removeLocations(List<Location> locations, SocialNetworkSource sourceType) {
for(Location location : locations) {
locationDAO.removeLocation(location, sourceType);
}
}
示例11: toMediaItem
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public MediaItem toMediaItem() throws MalformedURLException {
MediaItem mediaItem = new MediaItem(new URL(url));
mediaItem.setId(id);
mediaItem.setStreamId(streamId);
mediaItem.setThumbnail(thumbnail);
mediaItem.setTitle(title);
mediaItem.setDescription(description);
mediaItem.setTags(tags);
//author needs to be added here
mediaItem.setPublicationTime(publicationTime);
//popularity needs to be added here
mediaItem.setShares(popularity);
if (latitude != null && longitude != null && location != null) {
mediaItem.setLocation(new Location(latitude, longitude, location));
}
mediaItem.setType(type);
mediaItem.setClusterId(clusterId);
mediaItem.setSolrScore(solrScore);
List<Concept> conceptsList = new ArrayList<Concept>();
if (concepts != null) {
for (String concept : concepts) {
try {
Concept cpt = new Concept(concept, 0d);
conceptsList.add(cpt);
}
catch(Exception e) {
// Undefined concept type.
}
}
}
mediaItem.setConcepts(conceptsList);
return mediaItem;
}
示例12: toItem
import eu.socialsensor.framework.common.domain.Location; //导入依赖的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;
}
示例13: toCustomDysco
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public CustomDysco toCustomDysco() {
CustomDysco dysco = new CustomDysco(id, creationDate, DyscoType.CUSTOM);
dysco.setTitle(title);
dysco.setScore(score);
dysco.setContributors(contributors);
if (keywords != null) {
for (String keyword : keywords) {
dysco.addKeyword(keyword, 0.0);
}
}
if (hashtags != null) {
for (String hashtag : hashtags) {
dysco.addHashtag(hashtag, 0.0);
}
}
dysco.setSolrQueryString(solrQueryString);
List<Query> queries = new ArrayList<Query>();
for (int i = 0; i < solrQueriesString.size(); i++) {
Query query = new Query();
query.setName(solrQueriesString.get(i));
//TODO this is temporary - remove this check when NaN issue is fixed
if (solrQueriesScore.get(i).equals("NaN")) {
query.setScore(Double.parseDouble(solrQueriesScore.get(i)));
} else {
query.setScore(0.6);
}
queries.add(query);
}
dysco.setSolrQueries(queries);
dysco.setTrending(trending);
dysco.setUpdateDate(updateDate);
dysco.setListId(listId);
dysco.setTwitterUsers(twitterUsers);
dysco.setMentionedUsers(mentionedUsers);
dysco.setListsOfUsers(listsOfUsers);
dysco.setOtherSocialNetworks(otherSocialNetworks);
if (nearLocations != null) {
List<Location> _nearLocations = new ArrayList<Location>();
for (String s : nearLocations) {
String[] parts = s.split(",");
if (parts.length != 3) {
continue;
}
Location l = new Location(Double.parseDouble(parts[0]), Double.parseDouble(parts[1]),
Double.parseDouble(parts[2]));
_nearLocations.add(l);
}
dysco.setNearLocations(_nearLocations);
}
return dysco;
}
示例14: setLocations
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public void setLocations(List<Location> locations, SocialNetworkSource sourceType);
示例15: removeLocations
import eu.socialsensor.framework.common.domain.Location; //导入依赖的package包/类
public void removeLocations(List<Location> locations, SocialNetworkSource sourceType);