本文整理匯總了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);
}