![JAR search and dependency download from the Maven repository](/logo.png)
edu.berkeley.nlp.util.IdentityHashSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of berkeleyparser Show documentation
Show all versions of berkeleyparser Show documentation
The Berkeley parser analyzes the grammatical structure of natural language using probabilistic context-free grammars (PCFGs).
The newest version!
package edu.berkeley.nlp.util;
import java.util.*;
public class IdentityHashSet extends AbstractSet {
private final Map map = new IdentityHashMap();
public IdentityHashSet() { }
public IdentityHashSet(Collection extends E> c) { for(E o : c) add(o); }
public int size() { return map.size(); }
public boolean contains(Object o) { return map.containsKey(o); }
public Iterator iterator() { return map.keySet().iterator(); }
public boolean add(E o) { return map.put(o, o) == null; }
public boolean remove(Object o) { return map.remove(o) != null; }
public void clear() { map.clear(); }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy