public class CountMap<T>
extends java.lang.Object
Constructor | Description |
---|---|
CountMap() |
Constructor.
|
Modifier and Type | Method | Description |
---|---|---|
int |
addItem(T item) |
Counts an item.
|
void |
clear() |
Sets all the item counts to zero.
|
int |
getCount(T key) |
Returns the number of times a given item has been added.
|
java.util.Set<T> |
keySet() |
Returns a set of all the items with a count of at least one.
|
public int addItem(T item)
item
- item to countpublic int getCount(T key)
key
- item to countpublic java.util.Set<T> keySet()
public void clear()
Copyright © 2018 Central Laboratory of the Research Councils. All Rights Reserved.