Skip to content

Package: Tuple

Tuple

nameinstructionbranchcomplexitylinemethod
Tuple(Object, Object)
M: 0 C: 9
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 4
100%
M: 0 C: 1
100%
create(Object, Object)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
first()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
second()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2011-2013 EclipseSource Muenchen GmbH and others.
3: *
4: * All rights reserved. This program and the accompanying materials
5: * are made available under the terms of the Eclipse Public License 2.0
6: * which accompanies this distribution, and is available at
7: * https://www.eclipse.org/legal/epl-2.0/
8: *
9: * SPDX-License-Identifier: EPL-2.0
10: *
11: * Contributors:
12: * Edgar Mueller - initial API and implementation
13: ******************************************************************************/
14: package org.eclipse.emf.ecp.view.test.common.spi;
15:
16: /**
17: * Convenience class for returning multiple values at once.
18: *
19: * @author emueller
20: **/
21: public class Tuple<T, U> {
22:
23:         public static <A, B> Tuple<A, B> create(A first, B second) {
24:                 return new Tuple<A, B>(first, second);
25:         }
26:
27:         private final T t;
28:         private final U u;
29:
30:         public Tuple(T t, U u) {
31:                 this.t = t;
32:                 this.u = u;
33:         }
34:
35:         public T first() {
36:                 return t;
37:         }
38:
39:         public U second() {
40:                 return u;
41:         }
42: }