On 3 March 2011 18:56, Matt Benson <gudnabr...@gmail.com> wrote:
> [SNIP]
>> I don't love the new Pair class. We have an interface based version
>> here at OpenGamma to allow primitive implementations for performance.
>> I might be able to get our code released if there was interest.
>
> Providing interfaces without code that consumes them doesn't feel like
> [lang]'s mission; this is akin to providing exceptions we don't use
> IMHO.  It might be okay for Pair<L, R> to implement Map.Entry<L, R>,
> for example.  But when you say primitive implementations, do you mean
> implementations based around primitive types, or simplistic
> implementations?  If the latter, how much more simplistic could it
> get?

Our OpenGamma pair is an abstract class (not an interface!):
public abstract class Pair<A, B> implements Map.Entry<A, B>,
Comparable<Pair<A, B>>, Serializable

There are concrete implementations for ObjectsPair, DoublesPair,
IntDoublePair etc. where the user can access the primitive type
directly, or just use the base generified class. The question is
whether [lang] wants no Pair, a simple one, or a full-featured one
(where people may disagree on what full-featured should look like).

Stephen

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to