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
-
#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 <=>.
234 235 |
# File 'for_yard_product.rb', line 234 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 .
310 311 |
# File 'for_yard_product.rb', line 310 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).
318 319 |
# File 'for_yard_product.rb', line 318 def EMap.for_each first, last end |
Instance Method Details
#begin ⇒ EMap::Iterator
Return iterator to beginning
237 238 |
# File 'for_yard_product.rb', line 237 def begin end |
#clear ⇒ Object
Clear content
246 247 |
# File 'for_yard_product.rb', line 246 def clear end |
#end ⇒ EMap::Iterator
Return iterator to end
240 241 |
# File 'for_yard_product.rb', line 240 def end end |
#erase(position) ⇒ Object #erase(frist, last) ⇒ Object
292 293 |
# File 'for_yard_product.rb', line 292 def erase *args end |
#find(arg) ⇒ EMap::Iterator
Searches the container for an element with an object equivalent to the argument.
297 298 |
# File 'for_yard_product.rb', line 297 def find arg end |
#insert(position, key, value) ⇒ EMap::Iterator #insert(key, value) ⇒ Array
265 266 |
# File 'for_yard_product.rb', line 265 def insert *args end |
#insert_or_assign(k, v) ⇒ Array #insert_or_assign(position, k, v) ⇒ EMap::Iterator
278 279 |
# File 'for_yard_product.rb', line 278 def insert_or_assign *args end |
#lower_bound ⇒ EMap::Iterator
Return iterator to lower bound
252 253 |
# File 'for_yard_product.rb', line 252 def lower_bound end |
#size ⇒ Integer
Return container size
243 244 |
# File 'for_yard_product.rb', line 243 def size end |
#upper_bound ⇒ EMap::Iterator
Return iterator to upper bound
249 250 |
# File 'for_yard_product.rb', line 249 def upper_bound end |