| 
||||||||||
| 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(Collection<? extends E> c)
 | 
|
 void | 
clear()
 | 
|
 boolean | 
contains(Object o)
 | 
|
 boolean | 
containsAll(Collection<?> c)
 | 
|
 int | 
getCount(E o)
Return the count of the specified object.  | 
|
 boolean | 
isEmpty()
 | 
|
 Iterator<E> | 
iterator()
 | 
|
 boolean | 
remove(Object o)
 | 
|
 boolean | 
removeAll(Collection<?> c)
 | 
|
 boolean | 
retainAll(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.  | 
|
 Object[] | 
toArray()
 | 
|
 | 
toArray(T[] a)
 | 
|
 void | 
write(String fileName,
      int countCutoff)
Deprecated.  | 
|
 void | 
write(String fileName,
      int countCutoff,
      String delim)
Deprecated.  | 
|
 void | 
write(String fileName,
      int countCutoff,
      String delim,
      String encoding)
Deprecated.  | 
|
| 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(E o)
add in interface Collection<E>add in interface 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(String fileName,
                             int countCutoff)
CountedSet.
fileName - countCutoff - 
@Deprecated
public void write(String fileName,
                             int countCutoff,
                             String delim)
CountedSet.
fileName - countCutoff - delim - 
@Deprecated
public void write(String fileName,
                             int countCutoff,
                             String delim,
                             String encoding)
CountedSet.
fileName - countCutoff - delim - encoding - public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface Set<E>public void clear()
clear in interface Collection<E>clear in interface Set<E>public boolean contains(Object o)
contains in interface Collection<E>contains in interface Set<E>public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface Set<E>public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface Set<E>public boolean remove(Object o)
remove in interface Collection<E>remove in interface Set<E>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface Set<E>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface Set<E>public int size()
size in interface Collection<E>size in interface Set<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<E>public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface Set<E>
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||