|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.util.CountMap<T>
public class CountMap<T>
Keeps track of the number of times an item of type T has been added.
Constructor Summary | |
---|---|
CountMap()
Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CountMap()
Method Detail |
---|
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 © 2004 CLRC: Central Laboratory of the Research Councils. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |