Is there a good reason why there is no Pair
in Java? What would be the equivalent of this C++ construct? I would rather avoid reimplementing my own.<
How about http://www.javatuples.org/index.html I have found it very useful.
The javatuples offers you tuple classes from one to ten elements:
Unit (1 element)
Pair (2 elements)
Triplet (3 elements)
Quartet (4 elements)
Quintet (5 elements)
Sextet (6 elements)
Septet (7 elements)
Octet (8 elements)
Ennead (9 elements)
Decade (10 elements)