|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectopennlp.tools.util.NumberedSet
opennlp.tools.util.CountedNumberedSet
public class CountedNumberedSet
Set which counts the number of times a values are added to it and assigns them a unique positive index. These value can be accessed with the #getCount() or #getIndex() method.
| Constructor Summary | |
|---|---|
CountedNumberedSet()
Creates a new counted set. |
|
CountedNumberedSet(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. |
int |
getIndex(java.lang.Object key)
Returns the index for the specified key or -1 if specified value is not contain in this set. |
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 opennlp.tools.util.NumberedSet |
|---|
setIndex |
| 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 CountedNumberedSet()
public CountedNumberedSet(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.Setadd in class NumberedSetpublic 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 int getIndex(java.lang.Object key)
getIndex in class NumberedSetkey - The key to be checked.
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.SetaddAll in class NumberedSetpublic void clear()
clear in interface java.util.Collectionclear in interface java.util.Setclear in class NumberedSetpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Setcontains in class NumberedSetpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.SetcontainsAll in class NumberedSetpublic boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.SetisEmpty in class NumberedSetpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Setiterator in class NumberedSetpublic boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Setremove in class NumberedSetpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.SetremoveAll in class NumberedSetpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.SetretainAll in class NumberedSetpublic int size()
size in interface java.util.Collectionsize in interface java.util.Setsize in class NumberedSetpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.SettoArray in class NumberedSetpublic java.lang.Object[] toArray(java.lang.Object[] arg0)
toArray in interface java.util.CollectiontoArray in interface java.util.SettoArray in class NumberedSet
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||