Module: Java::JavaUtil::Collection
- Defined in:
- lib/caruby/import/java.rb
Overview
Aliases Java Collection methods with the standard Ruby Set counterpart, e.g. delete for remove.
Instance Method Summary collapse
-
#delete(item) ⇒ Object
Removes the given item from this collection.
-
#delete_if ⇒ Object
Removes the items from this collection for which the block given to this method returns a non-nil, non-false value.
- #to_a ⇒ Object
Instance Method Details
#delete(item) ⇒ Object
Removes the given item from this collection.
76 77 78 79 |
# File 'lib/caruby/import/java.rb', line 76 def delete(item) # can't alias delete to remove, since a Java interface doesn't implement any methods remove(item) end |
#delete_if ⇒ Object
Removes the items from this collection for which the block given to this method returns a non-nil, non-false value.
82 83 84 85 |
# File 'lib/caruby/import/java.rb', line 82 def delete_if removeAll(select { |item| yield item }) self end |