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
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int value)voiddecrement()booleanequals(Object o)intgetCount()inthashCode()voidincrement()voidreadExternal(ObjectInput in)voidreset()StringtoString()voidwriteExternal(ObjectOutput out)
-
-
-
Field Detail
-
TO_COUNT
public static final IntFunction<Counter> TO_COUNT
-
-
Method Detail
-
increment
public void increment()
-
decrement
public void decrement()
-
add
public void add(int value)
-
getCount
public int getCount()
-
reset
public void reset()
-
writeExternal
public void writeExternal(ObjectOutput out) throws IOException
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
public void readExternal(ObjectInput in) throws IOException
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
-