本文整理汇总了Java中com.google.common.collect.LinkedListMultimap.putAll方法的典型用法代码示例。如果您正苦于以下问题:Java LinkedListMultimap.putAll方法的具体用法?Java LinkedListMultimap.putAll怎么用?Java LinkedListMultimap.putAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.LinkedListMultimap
的用法示例。
在下文中一共展示了LinkedListMultimap.putAll方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateFeedMetaDataAt
import com.google.common.collect.LinkedListMultimap; //导入方法依赖的package包/类
@SuppressWarnings({"ResultOfMethodCallIgnored", "ConstantConditions"})
public static void updateFeedMetaDataAt(final Context context, final int position,
final List<String> metaData) {
final LinkedListMultimap<String, String> map = getFeedMetaData(context);
final String currentTitle = getFeedMetaDataTitleAt(context, position);
final String newTitle = metaData.get(TITLE);
final String category = metaData.get(FEED_ID);
final List<String> values = new ArrayList<>(map.removeAll(currentTitle));
values.set(CATEGORY, category);
map.putAll(newTitle, values);
putFeedMetaData(context, map);
updateCurrentFeedAdapterPosition(context, newTitle);
}
示例2: getAllPendingReplications
import com.google.common.collect.LinkedListMultimap; //导入方法依赖的package包/类
private LinkedListMultimap<DatanodeStorageInfo, BlockTargetPair> getAllPendingReplications() {
LinkedListMultimap<DatanodeStorageInfo, BlockTargetPair> repls =
LinkedListMultimap.create();
for (DatanodeDescriptor dn : nodes) {
List<BlockTargetPair> thisRepls = dn.getReplicationCommand(10);
if (thisRepls != null) {
for(DatanodeStorageInfo storage : dn.getStorageInfos()) {
repls.putAll(storage, thisRepls);
}
}
}
return repls;
}
示例3: putFeedMetaData
import com.google.common.collect.LinkedListMultimap; //导入方法依赖的package包/类
@SuppressWarnings("ResultOfMethodCallIgnored")
public static int putFeedMetaData(final Context context, final List<String> feedMetaData) {
final LinkedListMultimap<String, String> map = getFeedMetaData(context);
final String title = feedMetaData.get(TITLE);
final String category = feedMetaData.get(FEED_ID);
final String id = "";
final String feedUrl = feedMetaData.get(FEED_URL);
final List<String> keys = new ArrayList<>(map.asMap().keySet());
if (!map.isEmpty()) {
final String first = keys.get(0);
final String last = keys.get(keys.size() - 1);
if (first.compareToIgnoreCase(title) < 0) {
putCurrentFeedAdapterPosition(context, getCurrentFeedAdapterPosition(context) + 1);
} else if (last.compareToIgnoreCase(title) > 0) {
putCurrentFeedAdapterPosition(context, getCurrentFeedAdapterPosition(context) + 1);
}
}
map.putAll(title, Arrays.asList(category, id, feedUrl));
putFeedMetaData(context, map);
return getFeedMetaDataTitleIndexAfterUpdate(context, title);
}
示例4: getAllPendingReplications
import com.google.common.collect.LinkedListMultimap; //导入方法依赖的package包/类
private LinkedListMultimap<DatanodeDescriptor, BlockTargetPair> getAllPendingReplications() {
LinkedListMultimap<DatanodeDescriptor, BlockTargetPair> repls =
LinkedListMultimap.create();
for (DatanodeDescriptor dn : nodes) {
List<BlockTargetPair> thisRepls = dn.getReplicationCommand(10);
if (thisRepls != null) {
repls.putAll(dn, thisRepls);
}
}
return repls;
}
示例5: getAllPendingReplications
import com.google.common.collect.LinkedListMultimap; //导入方法依赖的package包/类
private LinkedListMultimap<DatanodeDescriptor, BlockTargetPair> getAllPendingReplications() {
LinkedListMultimap<DatanodeDescriptor, BlockTargetPair> repls =
LinkedListMultimap.create();
for (DatanodeDescriptor dn : nodes) {
List<BlockTargetPair> thisRepls = dn.getReplicationCommand(10);
if (thisRepls != null) {
repls.putAll(dn, thisRepls);
}
}
return repls;
}
示例6: playerTicketsLoaded
import com.google.common.collect.LinkedListMultimap; //导入方法依赖的package包/类
@Override
public ListMultimap<String, Ticket> playerTicketsLoaded(ListMultimap<String, Ticket> tickets, World world)
{
Multimap<String, Ticket> persistentPlayerTickets = HashMultimap.create();
LinkedListMultimap<String, Ticket> claimedTickets = LinkedListMultimap.create();
//int i = 0;
for (String player : tickets.keys())
{
//System.out.println("playerTicketsLoaded(): looping outer start: " + i);
for (Ticket ticket : tickets.get(player))
{
if (ticket != null)
{
/*if (ticket.world != null && ticket.world.provider != null) { System.out.println("playerTicketsLoaded(): looping: " + i + " world: " + world + " dim: " + ticket.world.provider.getDimensionId()); }
else { System.out.println("playerTicketsLoaded(): looping: " + i + " world: " + world); }
++i;*/
NBTTagCompound nbt = ticket.getModData();
// Only claim tickets that are used for persistent chunk loading
if (nbt != null && nbt.getBoolean("Persistent"))
{
//System.out.println("playerTicketsLoaded(): found persistent ticket");
persistentPlayerTickets.put(player, ticket);
}
}
}
}
claimedTickets.putAll(persistentPlayerTickets);
return claimedTickets;
}
示例7: putOutlines
import com.google.common.collect.LinkedListMultimap; //导入方法依赖的package包/类
@SuppressWarnings("ResultOfMethodCallIgnored")
public static void putOutlines(final Context context, final List<Outline> outlines) {
final LinkedListMultimap<String, String> map = getFeedMetaData(context);
final List<String> keys = new ArrayList<>(map.asMap().keySet());
final boolean keysEmpty = keys.isEmpty();
final String first;
final String last;
if (!keysEmpty) {
first = keys.get(0);
last = keys.get(keys.size() - 1);
} else {
first = null;
last = null;
}
for (final Outline outline : outlines) {
final String text = (String) outline.getElementOfOutline(ATTRIBUTE_TEXT);
String category = (String) outline.getElementOfOutline(ATTRIBUTE_PARENT_CATEGORY);
final String xmlUrl = (String) outline.getElementOfOutline(ATTRIBUTE_XML_URL);
if (!TextUtils.isEmpty(xmlUrl) && !TextUtils.isEmpty(text) && !map.containsKey(text)) {
final int position = getCurrentFeedAdapterPosition(context);
if (!keysEmpty) {
if (first.compareToIgnoreCase(text) < 0) {
putCurrentFeedAdapterPosition(context, position + 1);
} else if (last.compareToIgnoreCase(text) > 0) {
putCurrentFeedAdapterPosition(context, position + 1);
}
}
category = !TextUtils.isEmpty(category) ? category : "Other";
map.putAll(StringUtils.toUpperTrim(text), Arrays.asList(category, "", xmlUrl));
}
}
putFeedMetaData(context, map);
}