commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hein Meling <>
Subject [Commons-math] Why call the method valuesIterator()
Date Wed, 19 Oct 2005 11:59:26 GMT
Hi all,

I've just started using commons-math, and want to iterate over the set
of values in a Frequency object, but the method is called
valuesIterator() and not the usual iterator().  Why this change of

The reason I want it to be called iterator() is that I'm using it from
groovy, which support simplified iteration over objects that provide an
iterator() method.  That is, I could simply do:

freq.each { val ->
  println val + " " + freq.getCount(val)

With the current naming convention I have to do this:

    def iter = freq.valuesIterator()
    while (iter.hasNext()) {
      def val =
      println val + " " + freq.getCount(x)

Please consider changing this naming convention, or at least provide

Thanks for reading,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message