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


Java LinkedListMultimap.putAll方法代码示例

本文整理汇总了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);
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:18,代码来源:SharedPrefUtils.java

示例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;
}
 
开发者ID:naver,项目名称:hadoop,代码行数:14,代码来源:TestBlockManager.java

示例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);
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:29,代码来源:SharedPrefUtils.java

示例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;
}
 
开发者ID:ict-carch,项目名称:hadoop-plus,代码行数:12,代码来源:TestBlockManager.java

示例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;
}
 
开发者ID:hopshadoop,项目名称:hops,代码行数:12,代码来源:TestBlockManager.java

示例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;
}
 
开发者ID:maruohon,项目名称:enderutilities,代码行数:35,代码来源:ChunkLoading.java

示例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);
}
 
开发者ID:Applications-Development,项目名称:SimpleRssReader,代码行数:44,代码来源:SharedPrefUtils.java


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