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
convention??

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 = iter.next()
      println val + " " + freq.getCount(x)
    }

Please consider changing this naming convention, or at least provide
both.

Thanks for reading,

Hein


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to