Changeset 909622f for apps/addressbook


Ignore:
Timestamp:
Apr 18, 2016 1:17:57 PM (4 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
25bce10
Parents:
2d3d6f7
Message:

Addressbook: Rename ConfigIterator? to HostTxtIterator?

Location:
apps/addressbook/java/src/net/i2p/addressbook
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • apps/addressbook/java/src/net/i2p/addressbook/AddressBook.java

    r2d3d6f7 r909622f  
    185185        if (this.subFile != null) {
    186186            try {
    187                 return new ConfigIterator(this.subFile);
     187                return new HostTxtIterator(this.subFile);
    188188            } catch (IOException ioe) {
    189                 return new ConfigIterator();
     189                return new HostTxtIterator();
    190190            }
    191191        }
  • apps/addressbook/java/src/net/i2p/addressbook/HostTxtIterator.java

    r2d3d6f7 r909622f  
    4343 *  to ensure the underlying stream is closed.
    4444 *
    45  *  Warning - misnamed - this is not used for config files.
     45 *  This is not used for config files.
    4646 *  It is only used for subscriptions.
    4747 *
    48  *  @since 0.8.7
     48 *  @since 0.8.7, renamed from ConfigIterator in 0.9.26
    4949 */
    50 class ConfigIterator implements Iterator<Map.Entry<String, HostTxtEntry>>, Closeable {
     50class HostTxtIterator implements Iterator<Map.Entry<String, HostTxtEntry>>, Closeable {
    5151
    5252    private BufferedReader input;
    53     private ConfigEntry next;
     53    private MapEntry next;
    5454
    5555    /**
    5656     *  A dummy iterator in which hasNext() is always false.
    5757     */
    58     public ConfigIterator() {}
     58    public HostTxtIterator() {}
    5959
    6060    /**
    6161     *  An iterator over the key/value pairs in the file.
    6262     */
    63     public ConfigIterator(File file) throws IOException {
     63    public HostTxtIterator(File file) throws IOException {
    6464            FileInputStream fileStream = new FileInputStream(file);
    6565            input = new BufferedReader(new InputStreamReader(fileStream, "UTF-8"));
     
    7777                if (he == null)
    7878                    continue;
    79                 next = new ConfigEntry(he.getName(), he);
     79                next = new MapEntry(he.getName(), he);
    8080                return true;
    8181            }
     
    113113     *  The object returned by the iterator.
    114114     */
    115     private static class ConfigEntry implements Map.Entry<String, HostTxtEntry> {
     115    private static class MapEntry implements Map.Entry<String, HostTxtEntry> {
    116116        private final String key;
    117117        private final HostTxtEntry value;
    118118
    119         public ConfigEntry(String k, HostTxtEntry v) {
     119        public MapEntry(String k, HostTxtEntry v) {
    120120            key = k;
    121121            value = v;
Note: See TracChangeset for help on using the changeset viewer.