Re: Newbie help! Returning an enumeration



On Wed, 28 Dec 2005 20:24:05 GMT, "Andy Bailey"
<andy.bailey1@xxxxxxxxxxxx> wrote, quoted or indirectly quoted someone
who said :

> Do i need to Cast the ResultSet rs to an Enumeration
>type? Or am i totally barking up the wrong tree and i need to implement the
>Enumeration interface?

You need to return an object that implements the Enumeration (or
Iterator to be modern) Interface.

This class his burned into it the information needed to get at each
row, i.e. you pass it the resultset to its constructor. It can be an
anonymous class. Have a look at source code in src.zip that returns
Enumerations or Iterators to see how they do it.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.



Relevant Pages

  • Newbie help! Returning an enumeration
    ... What i want to do is to return the result (ResultSet) ... StkCollection stkColl= new StkCollection ... System.out.println("Testing getCategoryOfStk"); ... public Enumeration getCategoryOfStkthrows SQLException{ ...
    (comp.lang.java.help)
  • Newbie help! Returning an enumeration
    ... What i want to do is to return the result (ResultSet) ... StkCollection stkColl= new StkCollection ... System.out.println("Testing getCategoryOfStk"); ... public Enumeration getCategoryOfStkthrows SQLException{ ...
    (comp.lang.java.gui)
  • Re: My idea for filtering an Enumeration or Iterator
    ... > With an enumeration, there's no delete method, so lookahed is no ... > problem regardless of whether standard outer loop is done or something ... that Iterator takes the place of Enumeration. ...
    (comp.lang.java.programmer)
  • Re: How do I set up CollapsableHashtable to take parameters?
    ... Enumeration, ... Both HashMap and Iterator came out with Java 1.2, ... I have always loved Vector, this coming from a Tcl/PHP programmer ... who's used to Tcl lists and PHP arrays, ...
    (comp.lang.java.help)
  • Re: Jdk 1.5 extended for loop problem.
    ... > adaptor class like the one needed above a cleaner solution than just ... > allowing the extended for syntax to iterator over instances of Iterator ... If the for loop accepted only an Iterator or Enumeration, the syntax ...
    (comp.lang.java.programmer)