當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。