Class: Yk::ESet
- Inherits:
-
Object
- Object
- Yk::ESet
- Defined in:
- for_yard_product.rb
Overview
ESets are containers with external iterators that store unique elements 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| ... } ⇒ ESet::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 ⇒ ESet::Iterator
Return iterator to beginning.
-
#clear ⇒ Object
Clear content.
-
#end ⇒ ESet::Iterator
Return iterator to end.
- #erase(*args) ⇒ Object
-
#find(arg) ⇒ ESet::Iterator
Searches the container for an element with an object equivalent to the argument.
-
#initialize {|obj| ... } ⇒ ESet
constructor
initlialize with a block which returns comparing basis like Enumerable::sort_by, however using <, not <=>.
- #insert(*args) ⇒ Object
-
#lower_bound ⇒ ESet::Iterator
Return iterator to lower bound.
-
#size ⇒ Integer
Return container size.
-
#upper_bound ⇒ ESet::Iterator
Return iterator to upper bound.
Constructor Details
#initialize {|obj| ... } ⇒ ESet
initlialize with a block which returns comparing basis like Enumerable::sort_by, however using <, not <=>.
8 9 |
# File 'for_yard_product.rb', line 8 def initialize end |
Class Method Details
.find(first, last, obj = nil) {|obj| ... } ⇒ ESet::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 .
84 85 |
# File 'for_yard_product.rb', line 84 def ESet.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).
93 94 |
# File 'for_yard_product.rb', line 93 def ESet.for_each first, last end |
Instance Method Details
#add(position, obj) ⇒ True|False #add(obj) ⇒ True|False
48 49 |
# File 'for_yard_product.rb', line 48 def add *args end |
#begin ⇒ ESet::Iterator
Return iterator to beginning
11 12 |
# File 'for_yard_product.rb', line 11 def begin end |
#clear ⇒ Object
Clear content
20 21 |
# File 'for_yard_product.rb', line 20 def clear end |
#end ⇒ ESet::Iterator
Return iterator to end
14 15 |
# File 'for_yard_product.rb', line 14 def end end |
#erase(position) ⇒ Object #erase(frist, last) ⇒ Object
64 65 |
# File 'for_yard_product.rb', line 64 def erase *args end |
#find(arg) ⇒ ESet::Iterator
Searches the container for an element with an object equivalent to the argument.
70 71 |
# File 'for_yard_product.rb', line 70 def find arg end |
#insert(position, obj) ⇒ ESet::Iterator #insert(obj) ⇒ Array
37 38 |
# File 'for_yard_product.rb', line 37 def insert *args end |
#lower_bound ⇒ ESet::Iterator
Return iterator to lower bound
26 27 |
# File 'for_yard_product.rb', line 26 def lower_bound end |
#size ⇒ Integer
Return container size
17 18 |
# File 'for_yard_product.rb', line 17 def size end |
#upper_bound ⇒ ESet::Iterator
Return iterator to upper bound
23 24 |
# File 'for_yard_product.rb', line 23 def upper_bound end |