| Index: remoting/android/javatests/src/org/chromium/chromoting/Counter.java
|
| diff --git a/remoting/android/javatests/src/org/chromium/chromoting/Counter.java b/remoting/android/javatests/src/org/chromium/chromoting/Counter.java
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..dbdd2b259ca7870d9c6aeef43f91095646a9af4a
|
| --- /dev/null
|
| +++ b/remoting/android/javatests/src/org/chromium/chromoting/Counter.java
|
| @@ -0,0 +1,35 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +package org.chromium.chromoting;
|
| +
|
| +/**
|
| + * A pointer of an integer, users can {@link set} / {@link get} / {@link increment} /
|
| + * {@link decrement} to its value. This class is usually useful in test cases. This class is not
|
| + * thread-safe, for a thread-safe implementation, use
|
| + * {@link java.util.concurrent.atomic.AtomicInteger}.
|
| + */
|
| +public class Counter {
|
| + private int mV;
|
| +
|
| + public Counter() {
|
| + set(0);
|
| + }
|
| +
|
| + public void increment() {
|
| + mV++;
|
| + }
|
| +
|
| + public void decrement() {
|
| + mV--;
|
| + }
|
| +
|
| + public void set(int v) {
|
| + mV = v;
|
| + }
|
| +
|
| + public int get() {
|
| + return mV;
|
| + }
|
| +}
|
|
|