Class: Yk::EMMap
- Inherits:
-
Object
- Object
- Yk::EMMap
- Defined in:
- for_yard_product.rb
Overview
EMMaps are associative containers with external iterators that store elements formed by a combination of a key and a value, following a specific order, and where multiple elements can have equivalent keys. For use, 'Yk/ESet';include Yk;
Defined Under Namespace
Classes: Iterator
Class Method Summary collapse
-
.find(first, last, obj = nil) {|obj| ... } ⇒ EMMap::Iterator
Searches the container for an element with an object equivalent to the third argument and/or validated with the provided block in a range of elements ([first,last)), 'obj' and returns an iterator to it if found, otherwise it returns an iterator to .
-
.for_each(first, last) {|obj| ... } ⇒ Object
Applies given block to each of the elements in the range [first,last).
Instance Method Summary collapse
-
#begin ⇒ EMMap::Iterator
Return iterator to beginning.
-
#clear ⇒ Object
Clear content.
-
#end ⇒ EMMap::Iterator
Return iterator to end.
-
#erase(first, last) ⇒ Object
Removes from the set container a range of elements ([first,last)).
-
#initialize {|key| ... } ⇒ EMMap
constructor
initlialize with a block which returns comparing basis like Enumerable::sort_by, however using <, not <=>.
- #insert(*args) ⇒ Object
-
#lower_bound ⇒ EMMap::Iterator
Return iterator to lower bound.
-
#size ⇒ Integer
Return container size.
-
#upper_bound ⇒ EMMap::Iterator
Return iterator to upper bound.
Constructor Details
#initialize {|key| ... } ⇒ EMMap
initlialize with a block which returns comparing basis like Enumerable::sort_by, however using <, not <=>.
320 321 |
# File 'for_yard_product.rb', line 320 def initialize end |
Class Method Details
.find(first, last, obj = nil) {|obj| ... } ⇒ EMMap::Iterator
Searches the container for an element with an object equivalent to the third argument and/or validated with the provided block in a range of elements ([first,last)), 'obj' and returns an iterator to it if found, otherwise it returns an iterator to .
373 374 |
# File 'for_yard_product.rb', line 373 def EMMap.find first, last, obj = nil end |
.for_each(first, last) {|obj| ... } ⇒ Object
Applies given block to each of the elements in the range [first,last).
381 382 |
# File 'for_yard_product.rb', line 381 def EMMap.for_each first, last end |
Instance Method Details
#begin ⇒ EMMap::Iterator
Return iterator to beginning
323 324 |
# File 'for_yard_product.rb', line 323 def begin end |
#clear ⇒ Object
Clear content
332 333 |
# File 'for_yard_product.rb', line 332 def clear end |
#end ⇒ EMMap::Iterator
Return iterator to end
326 327 |
# File 'for_yard_product.rb', line 326 def end end |
#erase(first, last) ⇒ Object
Removes from the set container a range of elements ([first,last)). Iterators specifying a range within the set container to be removed: [first,last). i.e., the range includes all the elements between first and last, including the element pointed by first but not the one pointed by last.
360 361 |
# File 'for_yard_product.rb', line 360 def erase first, last end |
#insert(position, key, value) ⇒ EMMap::Iterator #insert(key, value) ⇒ EMMap::Iterator
351 352 |
# File 'for_yard_product.rb', line 351 def insert *args end |
#lower_bound ⇒ EMMap::Iterator
Return iterator to lower bound
338 339 |
# File 'for_yard_product.rb', line 338 def lower_bound end |
#size ⇒ Integer
Return container size
329 330 |
# File 'for_yard_product.rb', line 329 def size end |
#upper_bound ⇒ EMMap::Iterator
Return iterator to upper bound
335 336 |
# File 'for_yard_product.rb', line 335 def upper_bound end |