|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopennlp.tools.util.CountedSet
public class CountedSet
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(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
void |
clear()
|
boolean |
contains(java.lang.Object o)
|
boolean |
containsAll(java.util.Collection c)
|
int |
getCount(java.lang.Object o)
Return the count of the specified object. |
boolean |
isEmpty()
|
java.util.Iterator |
iterator()
|
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection c)
|
boolean |
retainAll(java.util.Collection c)
|
void |
setCount(java.lang.Object o,
int c)
Assigns the specified object the specified count in the set. |
int |
size()
|
void |
subtract(java.lang.Object o)
Reduces the count associated with this object by 1. |
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] arg0)
|
void |
write(java.lang.String fileName,
int countCutoff)
|
void |
write(java.lang.String fileName,
int countCutoff,
java.lang.String delim)
|
void |
write(java.lang.String fileName,
int countCutoff,
java.lang.String delim,
java.lang.String encoding)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, 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(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Setpublic void subtract(java.lang.Object o)
o - The object whose count is being reduced.
public void setCount(java.lang.Object o,
int c)
o - The object to be added or updated in the set.c - The count of the specified object.public int getCount(java.lang.Object o)
o - the object whose count needs to be determined.
public void write(java.lang.String fileName,
int countCutoff)
public void write(java.lang.String fileName,
int countCutoff,
java.lang.String delim)
public void write(java.lang.String fileName,
int countCutoff,
java.lang.String delim,
java.lang.String encoding)
public boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.Setpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.Setpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.Setpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.Setpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.Setpublic int size()
size in interface java.util.Collectionsize in interface java.util.Setpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.Setpublic java.lang.Object[] toArray(java.lang.Object[] arg0)
toArray in interface java.util.CollectiontoArray in interface java.util.Set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||