Package org.eclipse.collections.impl
Class Counter
java.lang.Object
org.eclipse.collections.impl.Counter
- All Implemented Interfaces:
Externalizable,Serializable
public final class Counter extends Object implements Externalizable
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:
- Serialized Form
-
Field Summary
Fields Modifier and Type Field Description static IntFunction<Counter>TO_COUNT -
Constructor Summary
-
Method Summary
Modifier and Type Method Description voidadd(int value)voiddecrement()booleanequals(Object o)intgetCount()inthashCode()voidincrement()voidreadExternal(ObjectInput in)voidreset()StringtoString()voidwriteExternal(ObjectOutput out)
-
Field Details
-
Constructor Details
-
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:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-