Range is not a sub-type of pair. You can think of a pair as being an ordered
set of 2 items. A Range is a contiguous set defined by a lower and upper
bound (which may or may not be inclusive). Given some flag
Clusive=Inclusive|Exclusive, then every range is uniquely identified by a
single Pair<Pair<Clusive, numeric>>. The in-memory representation of the
data defining a pair and a range may be the same, but they are not at all
the same kind of thing.

Matthew

On 18 May 2011 17:46, Matt Benson <gudnabr...@gmail.com> wrote:

> On Wed, May 18, 2011 at 11:32 AM, Gary Gregory <garydgreg...@gmail.com>
> wrote:
> > Why doesn't a Range does extend Pair? It's pretty clear (to me at least)
> > that a range is a pair of values.
> >
> > Because the Pair is in our tuple package, it means that it should follow
> > tuple logic and be thought of as an ordered list of elements, in this
> case
> > two elements.
> >
> > The methods that Range has that are not in Pair could be moved there.
> >
>
> IMHO a Range is not precisely a Pair, though it could define its
> _limits_ in those terms.
>
> Matt
>
> > --
> > Thank you,
> > Gary
> >
> > http://garygregory.wordpress.com/
> > http://garygregory.com/
> > http://people.apache.org/~ggregory/
> > http://twitter.com/GaryGregory
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
> For additional commands, e-mail: dev-h...@commons.apache.org
>
>


-- 
Matthew Pocock
mailto: turingatemyhams...@gmail.com
gchat: turingatemyhams...@gmail.com
msn: matthew_poc...@yahoo.co.uk
irc.freenode.net: drdozer
(0191) 2566550

Reply via email to