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


Java Table.cellSet方法代碼示例

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


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

示例1: MediaTypeClassifierImpl

import com.google.common.collect.Table; //導入方法依賴的package包/類
MediaTypeClassifierImpl(Iterable<? extends MediaType> mts) {
  Table<String, String, Set<MediaType>> typeTable =
      HashBasedTable.<String, String, Set<MediaType>>create();
  for (MediaType mt : mts) {
    String type = mt.type();
    String subtype = mt.subtype();
    Set<MediaType> typeSet = typeTable.get(type, subtype);
    if (typeSet == null) {
      typeSet = Sets.newLinkedHashSet();
      typeTable.put(type, subtype, typeSet);
    }
    typeSet.add(mt);
  }

  ImmutableTable.Builder<String, String, ImmutableSet<MediaType>> b =
      ImmutableTable.builder();
  for (Table.Cell<String, String, Set<MediaType>> cell
       : typeTable.cellSet()) {
    b.put(cell.getRowKey(), cell.getColumnKey(), ImmutableSet.copyOf(cell.getValue()));
  }
  this.types = b.build();
}
 
開發者ID:OWASP,項目名稱:url-classifier,代碼行數:23,代碼來源:MediaTypeClassifierBuilder.java

示例2: renewSecureStore

import com.google.common.collect.Table; //導入方法依賴的package包/類
/**
 * Renews the {@link SecureStore} for all the running applications.
 *
 * @param liveApps set of running applications that need to have secure store renewal
 * @param renewer the {@link SecureStoreRenewer} for renewal
 * @param mergeCredentials {@code true} to merge with existing credentials
 * @return a {@link Multimap} containing the application runs that were failed to have secure store renewed
 */
private Multimap<String, RunId> renewSecureStore(Table<String, RunId, YarnTwillController> liveApps,
                                                 SecureStoreRenewer renewer, boolean mergeCredentials) {
  Multimap<String, RunId> failureRenews = HashMultimap.create();

  // Renew the secure store for each running application
  for (Table.Cell<String, RunId, YarnTwillController> liveApp : liveApps.cellSet()) {
    String application = liveApp.getRowKey();
    RunId runId = liveApp.getColumnKey();
    YarnTwillController controller = liveApp.getValue();

    try {
      renewer.renew(application, runId, new YarnSecureStoreWriter(application, runId, controller, mergeCredentials));
    } catch (Exception e) {
      LOG.warn("Failed to renew secure store for {}:{}", application, runId, e);
      failureRenews.put(application, runId);
    }
  }

  return failureRenews;
}
 
開發者ID:apache,項目名稱:twill,代碼行數:29,代碼來源:YarnTwillRunnerService.java

示例3: getXPath

import com.google.common.collect.Table; //導入方法依賴的package包/類
static String getXPath(Table<ACTIONS, LinkedList<ATTRIBUTES>, LinkedList<XPathValues>> xPathTable) {
    String xPath = "";
    for (Table.Cell<ACTIONS, LinkedList<ATTRIBUTES>, LinkedList<XPathValues>> tableCell : xPathTable.cellSet()) {

        if (tableCell.getColumnKey() == null)
            Assert.assertTrue("attributesList is null", false);

        if (tableCell.getValue() == null)
            Assert.assertTrue("listOfListValues is null", false);

        for (ATTRIBUTES attribute : tableCell.getColumnKey()) {

            for (XPathValues values : tableCell.getValue()) {
                xPath = xPath + XPathBuilder.getXPath(tableCell.getRowKey(), attribute, values);
            }
        }
    }
    return xPath;
}
 
開發者ID:ViliamS,項目名稱:XPathBuilder,代碼行數:20,代碼來源:IXPath.java

示例4: SparseMatrix

import com.google.common.collect.Table; //導入方法依賴的package包/類
/**
 * Construct a sparse matrix with CRS structures (CCS structure optional).
 * 
 * @deprecated I don't recommend to use this method as it (takes time and)
 *             is better to constructe the column structure at the time when
 *             you construct the row structure (of data table). This method
 *             is put here (as an example) to show how to construct column
 *             structure according to the data table.
 */
public SparseMatrix(int rows, int cols,
		Table<Integer, Integer, Float> dataTable, boolean isCCSUsed) {
	numRows = rows;
	numColumns = cols;

	Multimap<Integer, Integer> colMap = null;

	if (isCCSUsed) {
		colMap = HashMultimap.create();
		for (Cell<Integer, Integer, Float> cell : dataTable.cellSet())
			colMap.put(cell.getColumnKey(), cell.getRowKey());
	}

	construct(dataTable, colMap);
}
 
開發者ID:kite1988,項目名稱:famf,代碼行數:25,代碼來源:SparseMatrix.java

示例5: calHangZhouIndexer

import com.google.common.collect.Table; //導入方法依賴的package包/類
private JSONObject calHangZhouIndexer(Table<Integer,Double,Integer> detail){

        double totalRemainHouseCount=0,totalPriceSum=0,totalDealCount=0;

        for(Table.Cell<Integer,Double,Integer> cell : detail.cellSet()){
            totalRemainHouseCount += cell.getRowKey();
            totalPriceSum += cell.getColumnKey();
            totalDealCount += cell.getValue();
        }

        totalPriceSum/=detail.size();


        double index = 0;
        if(totalRemainHouseCount != 0){
            index = totalPriceSum * 1000 * totalDealCount / totalRemainHouseCount;
        }

        ESOP.writeToES("log/daily_index_detail_es", String.format("[杭州市][%s]剩餘庫存:%f,銷售均價總和:%f,銷售數量:%f,指數:%f",
                LocalDateTime.now().toString(),totalRemainHouseCount,totalPriceSum,totalDealCount,index));

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("district","杭州市");
        jsonObject.put("index",index);
        return jsonObject;
    }
 
開發者ID:deanjin,項目名稱:houseHunter,代碼行數:27,代碼來源:indexCalculator.java

示例6: setAnimation

import com.google.common.collect.Table; //導入方法依賴的package包/類
public void setAnimation(Triple<Integer, Integer, Float> animData, Table<Integer, Optional<Node<?>>, Key> keyData)
{
    ImmutableTable.Builder<Integer, Node<?>, Key> builder = ImmutableTable.builder();
    for(Table.Cell<Integer, Optional<Node<?>>, Key> key : keyData.cellSet())
    {
        builder.put(key.getRowKey(), key.getColumnKey().or(this), key.getValue());
    }
    setAnimation(new Animation(animData.getLeft(), animData.getMiddle(), animData.getRight(), builder.build()));
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:10,代碼來源:B3DModel.java

示例7: getDepartmentByDistrict

import com.google.common.collect.Table; //導入方法依賴的package包/類
public List<DepartmentInfo> getDepartmentByDistrict(final Table<String, String, String> districtTable) throws IOException, ParserException {
    List<DepartmentInfo> departmentInfoList = new ArrayList<>();
    for (Table.Cell<String, String, String> cell : districtTable.cellSet()) {
        departmentInfoList.addAll(runDistrict(cell, true));
        try {
            Thread.sleep(1000);
        } catch (Exception e) {

        }
    }
    return departmentInfoList;
}
 
開發者ID:deanjin,項目名稱:houseHunter,代碼行數:13,代碼來源:DepartmentParser.java

示例8: endSummary

import com.google.common.collect.Table; //導入方法依賴的package包/類
protected Set<Cell<N, D, EdgeFunction<V>>> endSummary(N sP, D d3) {
	Table<N, D, EdgeFunction<V>> map = endSummary.get(sP, d3);
	if(map==null) return Collections.emptySet();
	return map.cellSet();
}
 
開發者ID:flankerhqd,項目名稱:JAADAS,代碼行數:6,代碼來源:IDESolver.java


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