Class: Critbit::ListCursor
Instance Attribute Summary collapse
-
#list ⇒ Object
readonly
Returns the value of attribute list.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Cursor
Instance Method Summary collapse
-
#initialize(type) ⇒ ListCursor
constructor
————————————————————————————.
-
#select(entry) ⇒ Object
————————————————————————————.
Constructor Details
#initialize(type) ⇒ ListCursor
712 713 714 715 716 717 718 719 720 721 |
# File 'lib/critbit.rb', line 712 def initialize(type) if (type != :key && type != :value) raise "Illegal type #{type}" end @type = type @list = Array.new end |
Instance Attribute Details
#list ⇒ Object (readonly)
Returns the value of attribute list.
705 706 707 |
# File 'lib/critbit.rb', line 705 def list @list end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
706 707 708 |
# File 'lib/critbit.rb', line 706 def type @type end |
Instance Method Details
#select(entry) ⇒ Object
727 728 729 730 |
# File 'lib/critbit.rb', line 727 def select(entry) @list << ((@type == :key)? entry.getKey() : entry.getValue()) Decision::CONTINUE end |