Skip to content

Method: toString()

1: package cz.cvut.kbss.jopa.datatype.util;
2:
3: import java.util.AbstractMap;
4:
5: /**
6: * Represents an ordered pair of values.
7: *
8: * @param <F> Type of the first value in the pair
9: * @param <S> Type of the second value in the pair
10: */
11: public final class Pair<F, S> extends AbstractMap.SimpleEntry<F, S> {
12:
13: public Pair(F first, S second) {
14: super(first, second);
15: }
16:
17: public F getFirst() {
18: return getKey();
19: }
20:
21: public S getSecond() {
22: return getValue();
23: }
24:
25: @Override
26: public String toString() {
27: return "(" + getFirst() + ", " + getSecond() + ")";
28: }
29: }