Class List Method List File List

# Class: Vertx::Counter

Inherits:
  Object
  - Object
  - Vertx::Counter
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb

## Instance Method Summary (collapse)

- - (Object) add_and_get(value = nil)
- - (Object) compare_and_set(expected = nil, value = nil)
- - (Object) decrement_and_get
- - (Object) get
- - (Object) get_and_add(value = nil)
- - (Object) get_and_increment
- - (Object) increment_and_get
- - (Counter) initialize(j_del) constructor
  A new instance of Counter.
- - (Object) j_del

## Constructor Details

### - (`Counter`) initialize(j_del)

Returns a new instance of Counter

    9
    10
    11
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 9

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) add_and_get(value = nil)

Raises:

- (`ArgumentError`)

    57
    58
    59
    60
    61
    62
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 57

    def add_and_get(value=nil)
      if value.class == Fixnum && block_given?
        return @j_del.java_method(:addAndGet, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(value,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling add_and_get(value)"
    end

### - (`Object`) compare_and_set(expected = nil, value = nil)

Raises:

- (`ArgumentError`)

    79
    80
    81
    82
    83
    84
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 79

    def compare_and_set(expected=nil,value=nil)
      if expected.class == Fixnum && value.class == Fixnum && block_given?
        return @j_del.java_method(:compareAndSet, [Java::long.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(expected,value,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling compare_and_set(expected,value)"
    end

### - (`Object`) decrement_and_get

Raises:

- (`ArgumentError`)

    47
    48
    49
    50
    51
    52
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 47

    def decrement_and_get
      if block_given?
        return @j_del.java_method(:decrementAndGet, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling decrement_and_get()"
    end

### - (`Object`) get

Raises:

- (`ArgumentError`)

    20
    21
    22
    23
    24
    25
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 20

    def get
      if block_given?
        return @j_del.java_method(:get, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get()"
    end

### - (`Object`) get_and_add(value = nil)

Raises:

- (`ArgumentError`)

    67
    68
    69
    70
    71
    72
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 67

    def get_and_add(value=nil)
      if value.class == Fixnum && block_given?
        return @j_del.java_method(:getAndAdd, [Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(value,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_and_add(value)"
    end

### - (`Object`) get_and_increment

Raises:

- (`ArgumentError`)

    38
    39
    40
    41
    42
    43
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 38

    def get_and_increment
      if block_given?
        return @j_del.java_method(:getAndIncrement, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_and_increment()"
    end

### - (`Object`) increment_and_get

Raises:

- (`ArgumentError`)

    29
    30
    31
    32
    33
    34
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 29

    def increment_and_get
      if block_given?
        return @j_del.java_method(:incrementAndGet, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling increment_and_get()"
    end

### - (`Object`) j_del

    14
    15
    16
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/counter.rb', line 14

    def j_del
      @j_del
    end