Re: when will Tuple be std?
- From: Eric Sosman <esosman@xxxxxxxxxxxxxxxxxxxx>
- Date: Fri, 28 Dec 2007 09:28:34 -0500
apm35@xxxxxxxxxxxxxxxxxx wrote:
I am an experienced C++ programmer who has just recently started
learning java. In C++ there is a type std::pair for an aggregate
consisting of a first element and second element. There are moves to
extend this in the next version of the std to provide a Tuple class as
a general case where the aggregate can contain more than two members.
I have the need for a Tuple in my java program and hoped it would be
there as std. I cannot find it.
I have found the project, http://javatuple.com/index.shtml, which is
useful and encouraging, but I wonder how long it will be before Tuple
is std. The fact that this project exists shows I am not the only one
that wants to see a Tuple class in java.
If the elements of your Tuple have some important
relationship to each other -- (x, f(x), f'(x), f''(x)),
for example -- then they probably belong in a class
that "understands" that relationship. If the elements
are just J. Random Thingummies whose only connection is
that one is first, another is second, and so on, then
you may as well use `new Object[N]', Java's built-in
all-purpose tuple.
If there's something else you're after, you'll need
to explain more fully; I'm feeling particularly dense
today.
--
Eric Sosman
esosman@xxxxxxxxxxxxxxxxxxxx
.
- References:
- when will Tuple be std?
- From: apm35
- when will Tuple be std?
- Prev by Date: Re: Help with packages getting started
- Next by Date: Re: Help with packages getting started
- Previous by thread: Re: when will Tuple be std?
- Next by thread: Re: when will Tuple be std?
- Index(es):