Class: Yk::EMSet
- Inherits:
-
Object
- Object
- Yk::EMSet
- Defined in:
- for_yard_product.rb
Overview
EMSets are containers with external iterators that store elements following a specific order, and where multiple elements can have equivalent values. For use, require 'Yk/ESet';include Yk;
Defined Under Namespace
Classes: Iterator
Class Method Summary collapse
-
.find(first, last, obj = nil) {|obj| ... } ⇒ EMSet::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 ⇒ EMSet::Iterator
Return iterator to beginning.
-
#clear ⇒ Object
Clear content.
-
#end ⇒ EMSet::Iterator
Return iterator to end.
- #erase(*args) ⇒ Object
-
#find(arg) ⇒ EMSet::Iterator
Searches the container for an element with an object equivalent to the argument.
-
#initialize {|obj| ... } ⇒ EMSet
constructor
initlialize with a block which returns comparing basis like Enumerable::sort_by, however using <, not <=>.
- #insert(*args) ⇒ Object
-
#lower_bound ⇒ EMSet::Iterator
Return iterator to lower bound.
-
#size ⇒ Integer
Return container size.
-
#upper_bound ⇒ EMSet::Iterator
Return iterator to upper bound.
Constructor Details
#initialize {|obj| ... } ⇒ EMSet
initlialize with a block which returns comparing basis like Enumerable::sort_by, however using <, not <=>.
121 122 |
# File 'for_yard_product.rb', line 121 def initialize end |
Class Method Details
.find(first, last, obj = nil) {|obj| ... } ⇒ EMSet::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 .
182 183 |
# File 'for_yard_product.rb', line 182 def EMSet.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).
190 191 |
# File 'for_yard_product.rb', line 190 def EMSet.for_each first, last end |
Instance Method Details
#begin ⇒ EMSet::Iterator
Return iterator to beginning
124 125 |
# File 'for_yard_product.rb', line 124 def begin end |
#clear ⇒ Object
Clear content
133 134 |
# File 'for_yard_product.rb', line 133 def clear end |
#end ⇒ EMSet::Iterator
Return iterator to end
127 128 |
# File 'for_yard_product.rb', line 127 def end end |
#erase(position) ⇒ Object #erase(frist, last) ⇒ Object
164 165 |
# File 'for_yard_product.rb', line 164 def erase *args end |
#find(arg) ⇒ EMSet::Iterator
Searches the container for an element with an object equivalent to the argument.
169 170 |
# File 'for_yard_product.rb', line 169 def find arg end |
#insert(position, obj) ⇒ EMSet::Iterator #insert(obj) ⇒ EMSet::Iterator
150 151 |
# File 'for_yard_product.rb', line 150 def insert *args end |
#lower_bound ⇒ EMSet::Iterator
Return iterator to lower bound
139 140 |
# File 'for_yard_product.rb', line 139 def lower_bound end |
#size ⇒ Integer
Return container size
130 131 |
# File 'for_yard_product.rb', line 130 def size end |
#upper_bound ⇒ EMSet::Iterator
Return iterator to upper bound
136 137 |
# File 'for_yard_product.rb', line 136 def upper_bound end |