Class Count<K extends Comparable<K>>
java.lang.Object
org.deltava.util.Count<K>
- Type Parameters:
K- the label class
- All Implemented Interfaces:
Comparable<Count<?>>
A counter class that has a label and a counter.
- Since:
- 12.4
- Version:
- 12.4
- Author:
- Luke
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static classCount.LabelComparator<K extends Comparable<K>>Label comparator class. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetLabel()Returns the counter label.intgetValue()Returns the counter value.inthashCode()voidinc()Increments the counter.static <K extends Comparable<K>>
Comparator<Count<K>> labelComparator(Class<K> c) Returns a comparator that compares based on label, rather than value.
-
Constructor Details
-
Count
-
-
Method Details
-
labelComparator
Returns a comparator that compares based on label, rather than value.- Parameters:
c- the generic class- Returns:
- a Comparator
-
inc
public void inc()Increments the counter. -
getLabel
-
getValue
public int getValue()Returns the counter value.- Returns:
- the value
-
compareTo
- Specified by:
compareToin interfaceComparable<K extends Comparable<K>>
-
hashCode
-