package org.apache.jdbm; import java.util.AbstractSet; import java.util.Iterator; /** * Wrapper for HTree to implement java.util.Map interface */ class HTreeSet extends AbstractSet { final HTree map; HTreeSet(HTree map) { this.map = map; } public Iterator iterator() { return map.keySet().iterator(); } public int size() { return map.size(); } public boolean isEmpty() { return map.isEmpty(); } public boolean contains(Object o) { return map.containsKey(o); } public boolean add(E e) { return map.put(e, Utils.EMPTY_STRING) == null; } public boolean remove(Object o) { return map.remove(o) == Utils.EMPTY_STRING; } public void clear() { map.clear(); } }