Class: Vertx::AsyncMap
- Inherits:
-
Object
- Object
- Vertx::AsyncMap
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb
Overview
An asynchronous map.
AsyncMap does not allow null to be used as a key or value.
Instance Method Summary (collapse)
-
- (void) clear { ... }
Clear all entries in the map.
-
- (void) get(k = nil) { ... }
Get a value from the map, asynchronously.
-
- (void) put(k = nil, v = nil, ttl = nil) { ... }
Like #put but specifying a time to live for the entry.
-
- (void) put_if_absent(k = nil, v = nil, ttl = nil) { ... }
Link #put_if_absent but specifying a time to live for the entry.
-
- (void) remove(k = nil) { ... }
Remove a value from the map, asynchronously.
-
- (void) remove_if_present(k = nil, v = nil) { ... }
Remove a value from the map, only if entry already exists with same value.
-
- (void) replace(k = nil, v = nil) { ... }
Replace the entry only if it is currently mapped to some value.
-
- (void) replace_if_present(k = nil, oldValue = nil, newValue = nil) { ... }
Replace the entry only if it is currently mapped to a specific value.
-
- (void) size { ... }
Provide the number of entries in the map.
Instance Method Details
- (void) clear { ... }
This method returns an undefined value.
Clear all entries in the map
108 109 110 111 112 113 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 108 def clear if true return @j_del.java_method(:clear, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling clear()" end |
- (void) get(k = nil) { ... }
This method returns an undefined value.
Get a value from the map, asynchronously.
25 26 27 28 29 30 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 25 def get(k=nil) if @j_arg_K.accept?(k) && true return @j_del.java_method(:get, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling get(#{k})" end |
- (void) put(k = nil, v = nil, ttl = nil) { ... }
This method returns an undefined value.
Like #put but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.
38 39 40 41 42 43 44 45 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 38 def put(k=nil,v=nil,ttl=nil) if @j_arg_K.accept?(k) && @j_arg_V.accept?(v) && true && ttl == nil return @j_del.java_method(:put, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),@j_arg_V.unwrap(v),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) elsif @j_arg_K.accept?(k) && @j_arg_V.accept?(v) && ttl.class == Fixnum && true return @j_del.java_method(:put, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),@j_arg_V.unwrap(v),ttl,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling put(#{k},#{v},#{ttl})" end |
- (void) put_if_absent(k = nil, v = nil, ttl = nil) { ... }
This method returns an undefined value.
Link #put_if_absent but specifying a time to live for the entry. Entry will expire and get evicted after the ttl.
53 54 55 56 57 58 59 60 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 53 def put_if_absent(k=nil,v=nil,ttl=nil) if @j_arg_K.accept?(k) && @j_arg_V.accept?(v) && true && ttl == nil return @j_del.java_method(:putIfAbsent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),@j_arg_V.unwrap(v),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } unless !block_given?)) elsif @j_arg_K.accept?(k) && @j_arg_V.accept?(v) && ttl.class == Fixnum && true return @j_del.java_method(:putIfAbsent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),@j_arg_V.unwrap(v),ttl,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling put_if_absent(#{k},#{v},#{ttl})" end |
- (void) remove(k = nil) { ... }
This method returns an undefined value.
Remove a value from the map, asynchronously.
65 66 67 68 69 70 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 65 def remove(k=nil) if @j_arg_K.accept?(k) && true return @j_del.java_method(:remove, [Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling remove(#{k})" end |
- (void) remove_if_present(k = nil, v = nil) { ... }
This method returns an undefined value.
Remove a value from the map, only if entry already exists with same value.
76 77 78 79 80 81 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 76 def remove_if_present(k=nil,v=nil) if @j_arg_K.accept?(k) && @j_arg_V.accept?(v) && true return @j_del.java_method(:removeIfPresent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),@j_arg_V.unwrap(v),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling remove_if_present(#{k},#{v})" end |
- (void) replace(k = nil, v = nil) { ... }
This method returns an undefined value.
Replace the entry only if it is currently mapped to some value
87 88 89 90 91 92 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 87 def replace(k=nil,v=nil) if @j_arg_K.accept?(k) && @j_arg_V.accept?(v) && true return @j_del.java_method(:replace, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),@j_arg_V.unwrap(v),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? @j_arg_V.wrap(ar.result) : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling replace(#{k},#{v})" end |
- (void) replace_if_present(k = nil, oldValue = nil, newValue = nil) { ... }
This method returns an undefined value.
Replace the entry only if it is currently mapped to a specific value
99 100 101 102 103 104 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 99 def replace_if_present(k=nil,oldValue=nil,newValue=nil) if @j_arg_K.accept?(k) && @j_arg_V.accept?(oldValue) && @j_arg_V.accept?(newValue) && true return @j_del.java_method(:replaceIfPresent, [Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::java.lang.Object.java_class,Java::IoVertxCore::Handler.java_class]).call(@j_arg_K.unwrap(k),@j_arg_V.unwrap(oldValue),@j_arg_V.unwrap(newValue),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling replace_if_present(#{k},#{oldValue},#{newValue})" end |
- (void) size { ... }
This method returns an undefined value.
Provide the number of entries in the map
117 118 119 120 121 122 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/async_map.rb', line 117 def size if true return @j_del.java_method(:size, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } unless !block_given?)) end raise ArgumentError, "Invalid arguments when calling size()" end |