Class Counter
java.lang.Object
edu.jas.util.Counter
- All Implemented Interfaces:
Serializable, Comparable<Counter>
Class for holding the list index used as key in TreeMap.
Implemented since Integer has no add() method.
Must implement Comparable so that TreeMap works with correct ordering.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
value
private int value
-
-
Constructor Details
-
Counter
public Counter()Counter. -
Counter
public Counter(int v) Counter.- Parameters:
v-
-
-
Method Details
-
intValue
public int intValue()intValue.- Returns:
- the value.
-
add
public void add(int v) add.- Parameters:
v-
-
equals
-
compareTo
compareTo.- Specified by:
compareToin interfaceComparable<Counter>- Parameters:
c- a Counter.- Returns:
- 1 if (this < c), 0 if (this == c), -1 if (this > c).
-
hashCode
-
toString
-