Object-oriented counter