T
- the object type that we countpublic class ObjectCountPair<T> extends Object
Constructor and Description |
---|
ObjectCountPair(T object,
int count)
Standard constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addCount(int add)
Adds argument number to the counter.
|
static Comparator<ObjectCountPair> |
countComparator()
Gets a comparator that compares the count.
|
int |
getCount()
Getter for the counter.
|
T |
getObject()
Getter for the object we are counting.
|
public ObjectCountPair(T object, int count)
object
- the object we are countingcount
- the number of copies we have of the objectpublic T getObject()
public int getCount()
public void addCount(int add)
add
- integer value to addpublic static Comparator<ObjectCountPair> countComparator()
Copyright © 2016–2021. All rights reserved.