Class: Yk::EMap
- Inherits:
-
Object
- Object
- Yk::EMap
- Defined in:
- for_yard_product.rb
Overview
EMaps are associative containers with external iterators that store elements formed by a combination of a key and a value, following a specific order. For use, require 'Yk/ESet';include Yk;
Defined Under Namespace
Classes: Iterator
Class Method Summary collapse
-
.find(first, last, obj = nil) {|obj| ... } ⇒ EMap::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
- #add(*args) ⇒ Object
-
#begin ⇒ EMap::Iterator
Return iterator to beginning.
-
#clear ⇒ Object
Clear content.
-
#end ⇒ EMap::Iterator
Return iterator to end.
- #erase(*args) ⇒ Object
-
#find(arg) ⇒ EMap::Iterator
Searches the container for an element with an object equivalent to the argument.
-
#initialize {|key| ... } ⇒ EMap
constructor
initlialize with a block which returns comparing basis like Enumerable::sort_by, however using <, not <=>.
- #insert(*args) ⇒ Object
- #insert_or_assign(*args) ⇒ Object
-
#lower_bound ⇒ EMap::Iterator
Return iterator to lower bound.
-
#size ⇒ Integer
Return container size.
-
#upper_bound ⇒ EMap::Iterator
Return iterator to upper bound.
Constructor Details
#initialize {|key| ... } ⇒ EMap
initlialize with a block which returns comparing basis like Enumerable::sort_by, however using <, not <=>.
288 289 |
# File 'for_yard_product.rb', line 288 def initialize end |
Class Method Details
.find(first, last, obj = nil) {|obj| ... } ⇒ EMap::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 .
381 382 |
# File 'for_yard_product.rb', line 381 def EMap.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).
390 391 |
# File 'for_yard_product.rb', line 390 def EMap.for_each first, last end |
Instance Method Details
#add(position, key, value) ⇒ True|False #add(key, value) ⇒ True|False
332 333 |
# File 'for_yard_product.rb', line 332 def add *args end |
#begin ⇒ EMap::Iterator
Return iterator to beginning
291 292 |
# File 'for_yard_product.rb', line 291 def begin end |
#clear ⇒ Object
Clear content
300 301 |
# File 'for_yard_product.rb', line 300 def clear end |
#end ⇒ EMap::Iterator
Return iterator to end
294 295 |
# File 'for_yard_product.rb', line 294 def end end |
#erase(position) ⇒ Object #erase(frist, last) ⇒ Object
361 362 |
# File 'for_yard_product.rb', line 361 def erase *args end |
#find(arg) ⇒ EMap::Iterator
Searches the container for an element with an object equivalent to the argument.
367 368 |
# File 'for_yard_product.rb', line 367 def find arg end |
#insert(position, key, value) ⇒ EMap::Iterator #insert(key, value) ⇒ Array
319 320 |
# File 'for_yard_product.rb', line 319 def insert *args end |
#insert_or_assign(k, v) ⇒ Array #insert_or_assign(position, k, v) ⇒ EMap::Iterator
345 346 |
# File 'for_yard_product.rb', line 345 def insert_or_assign *args end |
#lower_bound ⇒ EMap::Iterator
Return iterator to lower bound
306 307 |
# File 'for_yard_product.rb', line 306 def lower_bound end |
#size ⇒ Integer
Return container size
297 298 |
# File 'for_yard_product.rb', line 297 def size end |
#upper_bound ⇒ EMap::Iterator
Return iterator to upper bound
303 304 |
# File 'for_yard_product.rb', line 303 def upper_bound end |