|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectopennlp.tools.util.CountedSet<E>
public class CountedSet<E>
Set which counts the number of times a values are added to it. This value can be accessed with the #getCount method.
| Constructor Summary | |
|---|---|
CountedSet()
Creates a new counted set. |
|
CountedSet(int size)
Creates a new counted set of the specified initial size. |
|
| Method Summary | ||
|---|---|---|
boolean |
add(E o)
|
|
boolean |
addAll(java.util.Collection<? extends E> c)
|
|
void |
clear()
|
|
boolean |
contains(java.lang.Object o)
|
|
boolean |
containsAll(java.util.Collection<?> c)
|
|
int |
getCount(E o)
Return the count of the specified object. |
|
boolean |
isEmpty()
|
|
java.util.Iterator<E> |
iterator()
|
|
boolean |
remove(java.lang.Object o)
|
|
boolean |
removeAll(java.util.Collection<?> c)
|
|
boolean |
retainAll(java.util.Collection<?> c)
|
|
void |
setCount(E o,
int c)
Assigns the specified object the specified count in the set. |
|
int |
size()
|
|
void |
subtract(E o)
Reduces the count associated with this object by 1. |
|
java.lang.Object[] |
toArray()
|
|
|
toArray(T[] a)
|
|
void |
write(java.lang.String fileName,
int countCutoff)
Deprecated. |
|
void |
write(java.lang.String fileName,
int countCutoff,
java.lang.String delim)
Deprecated. |
|
void |
write(java.lang.String fileName,
int countCutoff,
java.lang.String delim,
java.lang.String encoding)
Deprecated. |
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.util.Set |
|---|
equals, hashCode |
| Constructor Detail |
|---|
public CountedSet()
public CountedSet(int size)
size - The initial size of this set.| Method Detail |
|---|
public boolean add(E o)
add in interface java.util.Collection<E>add in interface java.util.Set<E>public void subtract(E o)
o - The object whose count is being reduced.
public void setCount(E o,
int c)
o - The object to be added or updated in the set.c - The count of the specified object.public int getCount(E o)
o - the object whose count needs to be determined.
@Deprecated
public void write(java.lang.String fileName,
int countCutoff)
CountedSet.
fileName - countCutoff -
@Deprecated
public void write(java.lang.String fileName,
int countCutoff,
java.lang.String delim)
CountedSet.
fileName - countCutoff - delim -
@Deprecated
public void write(java.lang.String fileName,
int countCutoff,
java.lang.String delim,
java.lang.String encoding)
CountedSet.
fileName - countCutoff - delim - encoding - public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>addAll in interface java.util.Set<E>public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.Set<E>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<E>contains in interface java.util.Set<E>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<E>containsAll in interface java.util.Set<E>public boolean isEmpty()
isEmpty in interface java.util.Collection<E>isEmpty in interface java.util.Set<E>public java.util.Iterator<E> iterator()
iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in interface java.util.Set<E>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>remove in interface java.util.Set<E>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.Set<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.Set<E>public int size()
size in interface java.util.Collection<E>size in interface java.util.Set<E>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<E>toArray in interface java.util.Set<E>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<E>toArray in interface java.util.Set<E>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||