Mercurial > jhg
comparison src/org/tmatesoft/hg/util/Pair.java @ 235:fd845a53f53d
Experimental access to working dir parents
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Tue, 07 Jun 2011 04:54:13 +0200 |
parents | |
children | b015f3918120 |
comparison
equal
deleted
inserted
replaced
234:b2cfbe46f9b6 | 235:fd845a53f53d |
---|---|
1 /* | |
2 * Copyright (c) 2011 TMate Software Ltd | |
3 * | |
4 * This program is free software; you can redistribute it and/or modify | |
5 * it under the terms of the GNU General Public License as published by | |
6 * the Free Software Foundation; version 2 of the License. | |
7 * | |
8 * This program is distributed in the hope that it will be useful, | |
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 * GNU General Public License for more details. | |
12 * | |
13 * For information on how to redistribute this software under | |
14 * the terms of a license other than GNU General Public License | |
15 * contact TMate Software at support@hg4j.com | |
16 */ | |
17 package org.tmatesoft.hg.util; | |
18 | |
19 import org.tmatesoft.hg.internal.Experimental; | |
20 | |
21 /** | |
22 * Nothing but a holder for two values. | |
23 * | |
24 * @author Artem Tikhomirov | |
25 * @author TMate Software Ltd. | |
26 */ | |
27 @Experimental | |
28 public final class Pair<T1,T2> { | |
29 private final T1 value1; | |
30 private final T2 value2; | |
31 | |
32 public Pair(T1 v1, T2 v2) { | |
33 value1 = v1; | |
34 value2 = v2; | |
35 } | |
36 | |
37 public T1 first() { | |
38 return value1; | |
39 } | |
40 public T2 second() { | |
41 return value2; | |
42 } | |
43 public boolean hasFirst() { | |
44 return value1 != null; | |
45 } | |
46 public boolean hasSecond() { | |
47 return value2 != null; | |
48 } | |
49 } | |
50 |