Package org.eclipse.collections.impl
Class Counter
java.lang.Object
org.eclipse.collections.impl.Counter
- All Implemented Interfaces:
Externalizable
,Serializable
A Counter can be used to increment and return an integer count. A Counter can be used in Anonymous
inner classes if it is declared final, unlike an int, which once declared final cannot be modified.
- See Also:
-
Field Details
-
TO_COUNT
-
-
Constructor Details
-
Counter
public Counter(int startCount) -
Counter
public Counter()
-
-
Method Details
-
increment
public void increment() -
decrement
public void decrement() -
add
public void add(int value) -
getCount
public int getCount() -
reset
public void reset() -
toString
-
equals
-
hashCode
public int hashCode() -
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-