public class CountedSet<E> extends Object implements Set<E>
Constructor and Description |
---|
CountedSet()
Creates a new counted set.
|
CountedSet(int size)
Creates a new counted set of the specified initial size.
|
Modifier and Type | Method and Description |
---|---|
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() |
<T> T[] |
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.
|
public CountedSet()
public CountedSet(int size)
size
- The initial size of this set.public boolean add(E o)
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)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface Set<E>
public boolean isEmpty()
public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection<?> c)
public int size()
public Object[] toArray()
Copyright © 2015 The Apache Software Foundation. All rights reserved.