Menu

#21 io.SimpleFile :: Iterator for lines

open
5
2005-01-23
2005-01-23
eRom
No

Hi,

Is there a way to implement an Iterator in the
SimpleFile class (for lines Array) ?
Indeed we can get a specific line with the "getLine()"
method and the amount of lines in the file with
"countLines()".

It would be useful to be able to read the file from
beginning to the end, line by line with an iterator system.

Thanks.
eRom

Discussion

  • eRom

    eRom - 2005-01-23
    • summary: io.Simplefile :: Iterator for file lines --> io.SimpleFile :: Iterator for lines
     
  • Martin Heidegger

    Logged In: YES
    user_id=901744

    New File API works different and allows currently with
    File.getContent().lineIterator to get direct acces to the
    lines. But it in discussion to remove this mehtod since it
    is possible to get same functionality with

    new ArrayIterator(File.getContent().getLines());

    yours
    Martin.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.