Module: Java::JavaUtil::Collection
- Includes:
- Jinx::Collection
- Defined in:
- lib/jinx/import/java.rb,
lib/jinx/helpers/collections.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
Methods included from Jinx::Collection
#compact, #compact_map, #detect_value, #detect_with_value, #difference, #empty?, #filter, #first, #flatten, #hashify, #intersect, #join, #last, #partial_sort, #partial_sort!, #partial_sort_by, #size, #to_compact_hash, #to_compact_hash_with_index, #to_series, #transform, #union
Instance Method Details
#delete(item) ⇒ Object
Removes the given item from this collection.
35 36 37 38 |
# File 'lib/jinx/import/java.rb', line 35 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.
41 42 43 44 |
# File 'lib/jinx/import/java.rb', line 41 def delete_if removeAll(select { |item| yield item }) self end |