net.i2p.addressbook
Class ConfigIterator
java.lang.Object
net.i2p.addressbook.ConfigIterator
- All Implemented Interfaces:
- Closeable, Iterator<Map.Entry<String,String>>
class ConfigIterator
- extends Object
- implements Iterator<Map.Entry<String,String>>, Closeable
A class to iterate through a hosts.txt or config file without
reading the whole thing into memory.
Keys are always converted to lower case.
Callers should iterate all the way through or call close()
to ensure the underlying stream is closed.
- Since:
- 0.8.7
Constructor Summary |
ConfigIterator()
A dummy iterator in which hasNext() is always false. |
ConfigIterator(File file)
An iterator over the key/value pairs in the file. |
ConfigIterator
public ConfigIterator()
- A dummy iterator in which hasNext() is always false.
ConfigIterator
public ConfigIterator(File file)
throws IOException
- An iterator over the key/value pairs in the file.
- Throws:
IOException
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interface Iterator<Map.Entry<String,String>>
next
public Map.Entry<String,String> next()
- Specified by:
next
in interface Iterator<Map.Entry<String,String>>
remove
public void remove()
- Specified by:
remove
in interface Iterator<Map.Entry<String,String>>
close
public void close()
- Specified by:
close
in interface Closeable
finalize
protected void finalize()
- Overrides:
finalize
in class Object