All Downloads are FREE. Search and download functionalities are using the official Maven repository.

xapi.collect.impl.EntryValueAdapter Maven / Gradle / Ivy

package xapi.collect.impl;

import java.util.Iterator;
import java.util.Map.Entry;

public class EntryValueAdapter  implements Iterable {

  private class ValueIterator implements Iterator{
    private Iterator> source;
    public ValueIterator(Iterator> source) {
      this.source = source;
    }
    @Override
    public boolean hasNext() {
      return source.hasNext();
    }
    @Override
    public V next() {
      return source.next().getValue();
    }
    @Override
    public void remove() {
      source.remove();
    }
  }

  private Iterable> source;

  public EntryValueAdapter(Iterable> source) {
    this.source = source;
  }

  @Override
  public Iterator iterator() {
    return new ValueIterator(source.iterator());
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy