io.vertx.rxjava.core.shareddata

## Class Counter

- java.lang.Object
- - io.vertx.rxjava.core.shareddata.Counter

-     public class Counter
      extends Object

  An asynchronous counter that can be used to across the cluster to maintain a consistent count.

  NOTE: This class has been automatically generated from the `original` non RX-ified interface using Vert.x codegen.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Counter(Counter delegate)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addAndGet(long value, Handler<AsyncResult<Long>> resultHandler)` Add the value to the counter atomically and return the new count
    `rx.Observable<Long>` | `addAndGetObservable(long value)` Add the value to the counter atomically and return the new count
    `void` | `compareAndSet(long expected, long value, Handler<AsyncResult<Boolean>> resultHandler)` Set the counter to the specified value only if the current value is the expectec value.
    `rx.Observable<Boolean>` | `compareAndSetObservable(long expected, long value)` Set the counter to the specified value only if the current value is the expectec value.
    `void` | `decrementAndGet(Handler<AsyncResult<Long>> resultHandler)` Decrement the counter atomically and return the new count
    `rx.Observable<Long>` | `decrementAndGetObservable()` Decrement the counter atomically and return the new count
    `void` | `get(Handler<AsyncResult<Long>> resultHandler)` Get the current value of the counter
    `void` | `getAndAdd(long value, Handler<AsyncResult<Long>> resultHandler)` Add the value to the counter atomically and return the value before the add
    `rx.Observable<Long>` | `getAndAddObservable(long value)` Add the value to the counter atomically and return the value before the add
    `void` | `getAndIncrement(Handler<AsyncResult<Long>> resultHandler)` Increment the counter atomically and return the value before the increment.
    `rx.Observable<Long>` | `getAndIncrementObservable()` Increment the counter atomically and return the value before the increment.
    `Object` | `getDelegate()`
    `rx.Observable<Long>` | `getObservable()` Get the current value of the counter
    `void` | `incrementAndGet(Handler<AsyncResult<Long>> resultHandler)` Increment the counter atomically and return the new count
    `rx.Observable<Long>` | `incrementAndGetObservable()` Increment the counter atomically and return the new count
    `static Counter` | `newInstance(Counter arg)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Counter

          public Counter(Counter delegate)

  - ### Method Detail

    - #### getDelegate

          public Object getDelegate()

    - #### get

          public void get(Handler<AsyncResult<Long>> resultHandler)

      Get the current value of the counter
      Parameters:
        `resultHandler` - handler which will be passed the value

    - #### getObservable

          public rx.Observable<Long> getObservable()

      Get the current value of the counter
      Returns:

    - #### incrementAndGet

          public void incrementAndGet(Handler<AsyncResult<Long>> resultHandler)

      Increment the counter atomically and return the new count
      Parameters:
        `resultHandler` - handler which will be passed the value

    - #### incrementAndGetObservable

          public rx.Observable<Long> incrementAndGetObservable()

      Increment the counter atomically and return the new count
      Returns:

    - #### getAndIncrement

          public void getAndIncrement(Handler<AsyncResult<Long>> resultHandler)

      Increment the counter atomically and return the value before the increment.
      Parameters:
        `resultHandler` - handler which will be passed the value

    - #### getAndIncrementObservable

          public rx.Observable<Long> getAndIncrementObservable()

      Increment the counter atomically and return the value before the increment.
      Returns:

    - #### decrementAndGet

          public void decrementAndGet(Handler<AsyncResult<Long>> resultHandler)

      Decrement the counter atomically and return the new count
      Parameters:
        `resultHandler` - handler which will be passed the value

    - #### decrementAndGetObservable

          public rx.Observable<Long> decrementAndGetObservable()

      Decrement the counter atomically and return the new count
      Returns:

    - #### addAndGet

          public void addAndGet(long value,
                                Handler<AsyncResult<Long>> resultHandler)

      Add the value to the counter atomically and return the new count
      Parameters:
        `value` - the value to add
        `resultHandler` - handler which will be passed the value

    - #### addAndGetObservable

          public rx.Observable<Long> addAndGetObservable(long value)

      Add the value to the counter atomically and return the new count
      Parameters:
        `value` - the value to add
      Returns:

    - #### getAndAdd

          public void getAndAdd(long value,
                                Handler<AsyncResult<Long>> resultHandler)

      Add the value to the counter atomically and return the value before the add
      Parameters:
        `value` - the value to add
        `resultHandler` - handler which will be passed the value

    - #### getAndAddObservable

          public rx.Observable<Long> getAndAddObservable(long value)

      Add the value to the counter atomically and return the value before the add
      Parameters:
        `value` - the value to add
      Returns:

    - #### compareAndSet

          public void compareAndSet(long expected,
                                    long value,
                                    Handler<AsyncResult<Boolean>> resultHandler)

      Set the counter to the specified value only if the current value is the expectec value. This happens atomically.
      Parameters:
        `expected` - the expected value
        `value` - the new value
        `resultHandler` - the handler will be passed true on success

    - #### compareAndSetObservable

          public rx.Observable<Boolean> compareAndSetObservable(long expected,
                                                                long value)

      Set the counter to the specified value only if the current value is the expectec value. This happens atomically.
      Parameters:
        `expected` - the expected value
        `value` - the new value
      Returns:

    - #### newInstance

          public static Counter newInstance(Counter arg)

Copyright © 2015. All Rights Reserved.