Class Counter

java.lang.Object
java.lang.Number
org.apache.commons.lang3.mutable.MutableInt
ghidra.util.datastruct.Counter
All Implemented Interfaces:
Serializable, Comparable<org.apache.commons.lang3.mutable.MutableInt>, org.apache.commons.lang3.mutable.Mutable<Number>

public class Counter extends org.apache.commons.lang3.mutable.MutableInt
Simple class used to avoid immutable objects and autoboxing when storing changing integer primitives in a collection.
See Also:
  • Constructor Summary

    Constructors
    Change
    Constructor
    Description
    Construct a new counter with an initial value of 0.
    Counter(int value)
    Construct a new Counter with the given initial value.
  • Method Summary

    Change
    Modifier and Type
    Method
    Description
    NEW
    int
    Returns the value of this counter.
    REMOVED
    String
    Removed

    Methods inherited from class org.apache.commons.lang3.mutable.MutableInt

    add, add, addAndGet, addAndGet, compareTo, decrement, decrementAndGet, doubleValue, equals, floatValue, getAndAdd, getAndAdd, getAndDecrement, getAndIncrement, getValue, hashCode, increment, incrementAndGet, intValue, longValue, setValue, setValue, subtract, subtract, toInteger, toString

    Methods inherited from class java.lang.Number

    byteValue, shortValue

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Counter

      public Counter()
      Construct a new counter with an initial value of 0.
    • Counter

      public Counter(int value)
      Construct a new Counter with the given initial value.
      Parameters:
      value - the initial value
  • Method Details

    • count NEW

      public int count()
      Returns the value of this counter.
      Returns:
      the value of this counter