本文整理汇总了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();
}
示例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;
}
示例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;
}
示例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);
}
示例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;
}
示例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()));
}
示例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;
}
示例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();
}