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