當前位置: 首頁>>代碼示例>>Java>>正文


Java LinkedListMultimap.get方法代碼示例

本文整理匯總了Java中com.google.common.collect.LinkedListMultimap.get方法的典型用法代碼示例。如果您正苦於以下問題:Java LinkedListMultimap.get方法的具體用法?Java LinkedListMultimap.get怎麽用?Java LinkedListMultimap.get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.collect.LinkedListMultimap的用法示例。


在下文中一共展示了LinkedListMultimap.get方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateFeedMetaDataUrl

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
@SuppressWarnings("ResultOfMethodCallIgnored")
public static void updateFeedMetaDataUrl(final Context context, final String feedUrl) {
    final LinkedListMultimap<String, String> map = getFeedMetaData(context);

    final int position = getCurrentFeedAdapterPosition(context);

    int i = 0;

    for (final String title : map.asMap().keySet()) {
        if (i == position) {
            final List<String> values = new ArrayList<>(map.get(title));

            values.set(FEED_URL, feedUrl);

            map.replaceValues(title, values);

            putFeedMetaData(context, map);
            break;
        }
        i++;
    }
}
 
開發者ID:Applications-Development,項目名稱:SimpleRssReader,代碼行數:23,代碼來源:SharedPrefUtils.java

示例2: endVisit

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
@Override
public void endVisit(FieldDeclaration node) {
  LinkedListMultimap<Integer, VariableDeclarationFragment> newDeclarations =
      rewriteExtraDimensions(node.getType(), node.getFragments());
  if (newDeclarations != null) {
    List<BodyDeclaration> bodyDecls = TreeUtil.getBodyDeclarations(node.getParent());
    int location = 0;
    while (location < bodyDecls.size() && !node.equals(bodyDecls.get(location))) {
      location++;
    }
    for (Integer dimensions : newDeclarations.keySet()) {
      List<VariableDeclarationFragment> fragments = newDeclarations.get(dimensions);
      FieldDeclaration newDecl = new FieldDeclaration(fragments.get(0));
      newDecl.getFragments().addAll(fragments.subList(1, fragments.size()));
      bodyDecls.add(++location, newDecl);
    }
  }
}
 
開發者ID:Sellegit,項目名稱:j2objc,代碼行數:19,代碼來源:Rewriter.java

示例3: getFeedMetaDataValues

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
public static LinkedHashMap<String, String> getFeedMetaDataValues(final Context context) {
    final LinkedListMultimap<String, String> map = getFeedMetaData(context);
    final LinkedHashMap<String, String> values = new LinkedHashMap<>(map.asMap().size());

    for (final String title : map.asMap().keySet()) {
        final List<String>list = map.get(title);
        values.put(list.get(FEED_URL), list.get(FEED_ID));
    }

    return values;
}
 
開發者ID:Applications-Development,項目名稱:SimpleRssReader,代碼行數:12,代碼來源:SharedPrefUtils.java

示例4: updateFeedIdAt

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
@SuppressWarnings("ConstantConditions")
public static void updateFeedIdAt(final Context context, final int position,
                                  final String id) {
    final LinkedListMultimap<String, String> map = getFeedMetaData(context);

    final String currentTitle = getFeedMetaDataTitleAt(context, position);
    final List<String> values = new ArrayList<>(map.get(currentTitle));

    values.set(FEED_ID, id);

    map.replaceValues(currentTitle, values);

    putFeedMetaData(context, map);
}
 
開發者ID:Applications-Development,項目名稱:SimpleRssReader,代碼行數:15,代碼來源:SharedPrefUtils.java

示例5: checkAndGet

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
static List<String> checkAndGet(LinkedListMultimap<String,
    String> headers, String header) {
  List<String> result = new LinkedList<String>();
  if (headers == null) {
    result.add("");
    return result;
  }

  List<String> values = headers.get(header);
  if (values == null || values.isEmpty()) {
    result.add("");
    return result;
  }
  return values;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-fds-sdk-java,代碼行數:16,代碼來源:Signer.java

示例6: getExpires

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
static long getExpires(URI uri) {
  LinkedListMultimap<String, String> params = Utils.parseUriParameters(uri);
  List<String> expires = params.get(Common.EXPIRES);
  if (!expires.isEmpty()) {
    return Long.parseLong(expires.get(0));
  }
  return 0;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-fds-sdk-java,代碼行數:9,代碼來源:Signer.java

示例7: getSingleHeader

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
public static String getSingleHeader(String header,
    LinkedListMultimap<String, String> headers) {
  List<String> values = headers.get(header);
  if (values == null) {
    values = headers.get(header.toLowerCase());
  }

  if (values != null && !values.isEmpty()) {
    return values.get(0);
  }
  return null;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:13,代碼來源:HttpUtils.java

示例8: getSingleParam

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
public static String getSingleParam(String name, URI uri) {
  LinkedListMultimap<String, String> params = parseUriParameters(uri);
  if (params != null && !params.isEmpty()) {
    List<String> values = params.get(name);
    if (values == null) {
      values = params.get(name.toLowerCase());
    }

    if (values != null & !values.isEmpty()) {
      return values.get(0);
    }
  }
  return null;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:15,代碼來源:HttpUtils.java

示例9: canonicalizeXiaomiHeaders

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
static String canonicalizeXiaomiHeaders(
    LinkedListMultimap<String, String> headers) {
  if (headers == null) {
    return "";
  }

  // 1. Sort the header and merge the values
  Map<String, String> sortedHeaders = new TreeMap<String, String>();
  for (String key : headers.keySet()) {
    if (!key.toLowerCase().startsWith(HttpKeys.XIAOMI_HEADER_PREFIX)) {
      continue;
    }

    StringBuilder builder = new StringBuilder();
    int index = 0;
    for (String value : headers.get(key)) {
      if (index != 0) {
        builder.append(",");
      }
      builder.append(value);
      index++;
    }
    sortedHeaders.put(key, builder.toString());
  }

  // 3. Generate the canonicalized result
  StringBuilder result = new StringBuilder();
  for (Entry<String, String> entry : sortedHeaders.entrySet()) {
    result.append(entry.getKey()).append(":")
        .append(entry.getValue()).append("\n");
  }
  return result.toString();
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:34,代碼來源:Signer.java

示例10: canonicalizeResource

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
static String canonicalizeResource(URI uri) {
  StringBuilder result = new StringBuilder();
  result.append(uri.getPath());

  // 1. Parse and sort subresources
  TreeMap<String, String> sortedParams = new TreeMap<String, String>();
  LinkedListMultimap<String, String> params = parseUriParameters(uri);
  for (String key : params.keySet()) {
    for (String value : params.get(key)) {
      if (SUB_RESOURCE_SET.contains(key)) {
        sortedParams.put(key, value);
      }
    }
  }

  // 2. Generate the canonicalized result
  if (!sortedParams.isEmpty()) {
    result.append("?");
    boolean isFirst = true;
    for (Entry<String, String> entry : sortedParams.entrySet()) {
      if (isFirst) {
        isFirst = false;
        result.append(entry.getKey());
      } else {
        result.append("&").append(entry.getKey());
      }

      if (!entry.getValue().isEmpty()) {
        result.append("=").append(entry.getValue());
      }
    }
  }
  return result.toString();
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:35,代碼來源:Signer.java

示例11: checkAndGet

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
static List<String> checkAndGet(LinkedListMultimap<String, String> headers,
    String header) {
  List<String> result = new LinkedList<String>();
  if (headers == null) {
    result.add("");
    return result;
  }

  List<String> values = headers.get(header);
  if (values == null || values.isEmpty()) {
    result.add("");
    return result;
  }
  return values;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:16,代碼來源:Signer.java

示例12: getExpires

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
static long getExpires(URI uri) {
  LinkedListMultimap<String, String> params = parseUriParameters(uri);
  List<String> expires = params.get(HttpKeys.EXPIRES);
  if (expires != null && !expires.isEmpty()) {
    return Long.parseLong(expires.get(0));
  }
  return 0;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:9,代碼來源:Signer.java

示例13: getAccessKeyId

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
public static String getAccessKeyId(URI uri) {
  Preconditions.checkNotNull(uri);
  String query = uri.getQuery();
  if (query != null) {
    LinkedListMultimap<String, String> params =
        HttpUtils.parseUriParameters(uri);
    List<String> keyIds = params.get(HttpKeys.GALAXY_ACCESS_KEY_ID);
    if (!keyIds.isEmpty()) {
      return params.get(HttpKeys.GALAXY_ACCESS_KEY_ID).get(0);
    }
  }
  return null;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:14,代碼來源:SignatureUtil.java

示例14: getSignature

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
public static String getSignature(URI uri) {
  Preconditions.checkNotNull(uri);
  String query = uri.getQuery();
  if (query != null) {
    LinkedListMultimap<String, String> params =
        HttpUtils.parseUriParameters(uri);
    List<String> signatures = params.get(HttpKeys.SIGNATURE);
    if (!signatures.isEmpty()) {
      return params.get(HttpKeys.SIGNATURE).get(0);
    }
  }
  return null;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:14,代碼來源:SignatureUtil.java

示例15: getDateTime

import com.google.common.collect.LinkedListMultimap; //導入方法依賴的package包/類
public static long getDateTime(LinkedListMultimap<String, String> headers) {
  List<String> dateList = headers.get(HttpKeys.MI_DATE);
  if (dateList.isEmpty()) {
    dateList = headers.get(HttpKeys.DATE);
  }

  if (!dateList.isEmpty()) {
    String datetime = dateList.get(0);
    return HttpUtils.parseDateTimeToMilliseconds(datetime);
  }
  return 0;
}
 
開發者ID:XiaoMi,項目名稱:galaxy-sdk-java,代碼行數:13,代碼來源:SignatureUtil.java


注:本文中的com.google.common.collect.LinkedListMultimap.get方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。