当前位置: 首页>>代码示例>>Java>>正文


Java Triplet.getValue0方法代码示例

本文整理汇总了Java中org.javatuples.Triplet.getValue0方法的典型用法代码示例。如果您正苦于以下问题:Java Triplet.getValue0方法的具体用法?Java Triplet.getValue0怎么用?Java Triplet.getValue0使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.javatuples.Triplet的用法示例。


在下文中一共展示了Triplet.getValue0方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onAttachmentReceived

import org.javatuples.Triplet; //导入方法依赖的package包/类
private void onAttachmentReceived(BotMessage botMsg, Message message,
                                  String fileId, BotDocumentType type,
                                  String msgId) {
    try {
        Triplet<byte[], String, String> data = downloadFromFileId(fileId);

        BotTextMessage textMessage = new BotTextMessage(botMsg, message.getCaption());
        BotDocumentMessage documentMessage = new BotDocumentMessage(textMessage,
                data.getValue1(), data.getValue2(), data.getValue0(), type);

        botsController.sendMessage(documentMessage,
                Long.toString(message.getChatId()), Optional.of(msgId));
    } catch (TelegramApiException | IOException e) {
        logger.error("Error loading the media received. ", e);
    }
}
 
开发者ID:KDE,项目名称:brooklyn,代码行数:17,代码来源:TelegramBot.java

示例2: asList

import org.javatuples.Triplet; //导入方法依赖的package包/类
@Test
public void asList() throws Exception {
    final Instant now = now();
    final RestModel restModel = RestModel.newRestModel();
    final List<Triplet<Class<?>, Object, Object>> fixtures = new ArrayList<>();
    fixtures.add(new Triplet<>(Boolean.class, Arrays.asList(true), Arrays.asList(true)));
    fixtures.add(new Triplet<>(Byte.class, Arrays.asList((byte) 1), Arrays.asList((byte) 1)));
    fixtures.add(new Triplet<>(Short.class, Arrays.asList((short) 1), Arrays.asList((short) 1)));
    fixtures.add(new Triplet<>(Integer.class, Arrays.asList(1), Arrays.asList(1)));
    fixtures.add(new Triplet<>(Long.class, Arrays.asList(1l), Arrays.asList(1l)));
    fixtures.add(new Triplet<>(String.class, Arrays.asList("name"), Arrays.asList("name")));
    fixtures.add(new Triplet<>(State.class, Arrays.asList("BLOCKED"), Arrays.asList(BLOCKED)));
    fixtures.add(new Triplet<>(Instant.class, Arrays.asList(now), Arrays.asList(now)));
    fixtures.add(new Triplet<>(RestModel.class, Arrays.asList(restModel), Arrays.asList(restModel)));
    for (int i = 0; i < fixtures.size(); i++) {
        final Triplet<Class<?>, Object, Object> fixture = fixtures.get(i);
        final Class<?> type = fixture.getValue0();
        final Object input = fixture.getValue1();
        final Object expected = fixture.getValue2();
        final List<?> output = new RestValue(input).asListOf(type);
        assertEquals(expected, output);
    }
}
 
开发者ID:bxfsh,项目名称:boxfish-commons-web-model,代码行数:24,代码来源:RestValueTest.java

示例3: add

import org.javatuples.Triplet; //导入方法依赖的package包/类
@Override
public void add(Triplet<R, C, V> triplet) {
	R row = triplet.getValue0();
	GroupCollector<R, R2> rowCollector = rowCollectors.get(row);
	if (rowCollector == null) {
		rowCollector = rowExpression.createGroupCollector();
		rowCollectors.put(row, rowCollector);
	}
	rowCollector.add(row);
	
	C column = triplet.getValue1();
	GroupCollector<C, C2> columnCollector = columnCollectors.get(column);
	if (columnCollector == null) {
		columnCollector = columnExpression.createGroupCollector();
		columnCollectors.put(column, columnCollector);
	}
	columnCollector.add(column);
	
	GroupCollector<V, V2> valueCollector = valueCollectors.get(rowCollector, columnCollector);
	if (valueCollector == null) {
		valueCollector = valueExpression.createGroupCollector();
		valueCollectors.put(rowCollector, columnCollector, valueCollector);
	}
	V value = triplet.getValue2();
	valueCollector.add(value);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:27,代码来源:GTable.java

示例4: addEntry

import org.javatuples.Triplet; //导入方法依赖的package包/类
@Override
public void addEntry(Integer upstreamTask, Object originId, Object tupleId) {
  for(Triplet<Integer, Object, TupleIdSet> ee : _buffer) {
    if (ee.getValue0() == upstreamTask) {
      if (ee.getValue1() == null) {
        if (originId == null) {
          ee.getValue2().add(tupleId);
          return;
        }
      } else if (ee.getValue1().equals(originId)) {
        ee.getValue2().add(tupleId);
        return;
      }
    }
  }
  TupleIdSet tupleSet = new UncompressedTupleIdSet();
  _buffer.add(new Triplet<Integer, Object, TupleIdSet>(upstreamTask, originId, tupleSet ));
  tupleSet.add(tupleId);
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:20,代码来源:UncompressedTupleIdMapper.java

示例5: ensureEntry

import org.javatuples.Triplet; //导入方法依赖的package包/类
@Override
public void ensureEntry(Integer upstreamTask, Object originTuple) {
  for(Triplet<Integer, Object, TupleIdSet> ee : _buffer) {
    if (ee.getValue0() == upstreamTask) {
      if (ee.getValue1() == null) {
        if (originTuple == null) {
          return;
        }
      } else if (ee.getValue1().equals(originTuple)) {
        return;
      }
    }
  }
  TupleIdSet tupleSet = new UncompressedTupleIdSet();
  _buffer.add(new Triplet<Integer, Object, TupleIdSet>(upstreamTask, originTuple, tupleSet ));
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:17,代码来源:UncompressedTupleIdMapper.java

示例6: setupComplete

import org.javatuples.Triplet; //导入方法依赖的package包/类
private void setupComplete(Triplet<KeyStore, KeyStore, String> keystoreAux, Timer timer) {
  KeyStore keystore = keystoreAux.getValue0();
  KeyStore truststore = keystoreAux.getValue1();
  String certPswd = keystoreAux.getValue2();
  delaStateCtrl.hopssiteCertsAvailable(keystore, truststore, certPswd);
  delaVersion(resetToDelaVersion(timer));
}
 
开发者ID:hopshadoop,项目名称:hopsworks,代码行数:8,代码来源:DelaSetupWorker.java

示例7: getQueueCount

import org.javatuples.Triplet; //导入方法依赖的package包/类
private int getQueueCount(){
  
  if (_collector instanceof CoordinatedOutputCollector) {
    Triplet<Integer, Integer, Integer> queues = ((CoordinatedOutputCollector) _collector)
  .getUnackedAndLocalQueueAndRemoteQueeuCount_ThreadUnsafe();
    int unacked = queues.getValue0();
    int local = queues.getValue1();
    int remote = queues.getValue2();
    _operationLogger.writeLog("Queue Sizes = Unacked: " + unacked + " Local: " + local + " Remote: "
        + remote, OperationLogger.LogPriority.SYSTEM);
    return unacked + local + remote;
  }
  
 return 0;
}
 
开发者ID:zillabyte,项目名称:motherbrain,代码行数:16,代码来源:Operation.java

示例8: getMethodInsnNode

import org.javatuples.Triplet; //导入方法依赖的package包/类
public static MethodInsnNode getMethodInsnNode(int opcode, String method, boolean intf) {
	Triplet<String, String, String[]> methodDesc = ASMNames.getSrgNameMd(method);

	return new MethodInsnNode(opcode, methodDesc.getValue0(), methodDesc.getValue1(), methodDesc.getValue2()[0], intf);
}
 
开发者ID:roryclaasen,项目名称:RorysMod,代码行数:6,代码来源:ASMHelper.java

示例9: getFieldInsnNode

import org.javatuples.Triplet; //导入方法依赖的package包/类
public static FieldInsnNode getFieldInsnNode(int opcode, String field) {
	Triplet<String, String, String> fieldDesc = ASMNames.getSrgNameFd(field);

	return new FieldInsnNode(opcode, fieldDesc.getValue0(), fieldDesc.getValue1(), fieldDesc.getValue2());
}
 
开发者ID:roryclaasen,项目名称:RorysMod,代码行数:6,代码来源:ASMHelper.java

示例10: main

import org.javatuples.Triplet; //导入方法依赖的package包/类
public static void main(String[] args) {
		System.out.println("Solve problem 61");
		
		List<Triplet<Integer, Integer, Integer>> l3 = prepareList(new TriangleSequence(), 3);
		List<Triplet<Integer, Integer, Integer>> l4 = prepareList(new SquareSequence(), 4);
		List<Triplet<Integer, Integer, Integer>> l5 = prepareList(new PentagonalSequence(), 5);
		List<Triplet<Integer, Integer, Integer>> l6 = prepareList(new HexagonalSequence(), 6);
		List<Triplet<Integer, Integer, Integer>> l7 = prepareList(new HeptagonalSequence(), 7);
		List<Triplet<Integer, Integer, Integer>> l8 = prepareList(new OctagonalSequence(), 8);

		List<Triplet<Integer, Integer, Integer>> l = new ArrayList<Triplet<Integer, Integer, Integer>>();
		l.addAll(l3);
		l.addAll(l4);
		l.addAll(l5);
		l.addAll(l6);
		l.addAll(l7);
		l.addAll(l8);
		
		int sum = 0;

//		for (Triplet<Integer, Integer, Integer> i0 : l) {
//			for (Triplet<Integer, Integer, Integer> i1 : l) {
//				if (last2digits((Integer) i0.getValue0()) == first2digits((Integer) i1.getValue0())) {
//					for (Triplet<Integer, Integer, Integer> i2 : l) {
//						if (last2digits((Integer) i1.getValue0()) == first2digits((Integer) i2.getValue0())
//							&& last2digits((Integer) i2.getValue0()) == first2digits((Integer) i0.getValue0())
//							&& checkBases(i0, i1, i2) && i0.getValue1() == 3) {
//								System.out.println("i0 = " + i0);
//								System.out.println("i1 = " + i1);
//								System.out.println("i2 = " + i2);
//													
//								sum += (i0.getValue0() + i1.getValue0() + i2.getValue0());
//								System.out.println("sum = " + sum);
//							}															
//						}
//					}								
//				}
//			}			
//		}

		
		for (Triplet<Integer, Integer, Integer> i0 : l) {
			for (Triplet<Integer, Integer, Integer> i1 : l) {
				if (last2digits((Integer) i0.getValue0()) == first2digits((Integer) i1.getValue0())) {
					for (Triplet<Integer, Integer, Integer> i2 : l) {
						if (last2digits((Integer) i1.getValue0()) == first2digits((Integer) i2.getValue0())) {
							for (Triplet<Integer, Integer, Integer> i3 : l) {
								if (last2digits((Integer) i2.getValue0()) == first2digits((Integer) i3.getValue0())) {
									for (Triplet<Integer, Integer, Integer> i4 : l) {
										if (last2digits((Integer) i3.getValue0()) == first2digits((Integer) i4.getValue0())) {
											for (Triplet<Integer, Integer, Integer> i5 : l) {
												if (last2digits((Integer) i4.getValue0()) == first2digits((Integer) i5.getValue0())
														&& last2digits((Integer) i5.getValue0()) == first2digits((Integer) i0.getValue0())
														//&& checkBases(i0, i1, i2, i3, i4, i5) && i0.getValue1() == 3) {
														&& checkBases(i0, i1, i2, i3, i4, i5)) {
													System.out.println("i0 = " + i0);
													System.out.println("i1 = " + i1);
													System.out.println("i2 = " + i2);
													System.out.println("i3 = " + i3);
													System.out.println("i4 = " + i4);
													System.out.println("i5 = " + i5);
													
													sum += (i0.getValue0() + i1.getValue0() + i2.getValue0() + i3.getValue0() + i4.getValue0() + i5.getValue0());
													System.out.println("sum = " + sum);
												}
											}															
										}
									}															
								}
							}															
						}
					}								
				}
			}			
		}
	}
 
开发者ID:coms,项目名称:ep,代码行数:77,代码来源:Problem61.java


注:本文中的org.javatuples.Triplet.getValue0方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。