Class: MDArray::IteratorFast
- Inherits:
-
Object
- Object
- MDArray::IteratorFast
- Defined in:
- lib/mdarray/counter.rb
Overview
Direct Known Subclasses
IteratorFastBoolean, IteratorFastByte, IteratorFastChar, IteratorFastDouble, IteratorFastFloat, IteratorFastInt, IteratorFastLong, IteratorFastShort
Instance Attribute Summary collapse
-
#iterator ⇒ Object
readonly
Returns the value of attribute iterator.
-
#mdarray ⇒ Object
readonly
Returns the value of attribute mdarray.
Instance Method Summary collapse
-
#get_current ⇒ Object
(also: #[])
————————————————————————————.
-
#get_current_counter ⇒ Object
———————————————————————————— Returns the current counter as a ruby array ————————————————————————————.
-
#get_next ⇒ Object
————————————————————————————.
-
#has_next? ⇒ Boolean
————————————————————————————.
-
#initialize(mdarray) ⇒ IteratorFast
constructor
————————————————————————————-.
-
#jget_current_counter ⇒ Object
————————————————————————————- Returns the current counter as a java array.
-
#next ⇒ Object
————————————————————————————.
-
#set_current(value) ⇒ Object
(also: #[]=)
————————————————————————————.
-
#set_next(value) ⇒ Object
————————————————————————————.
Constructor Details
#initialize(mdarray) ⇒ IteratorFast
604 605 606 607 |
# File 'lib/mdarray/counter.rb', line 604 def initialize(mdarray) @mdarray = mdarray @iterator = mdarray.nc_array.getIndexIterator() end |
Instance Attribute Details
#iterator ⇒ Object (readonly)
Returns the value of attribute iterator.
598 599 600 |
# File 'lib/mdarray/counter.rb', line 598 def iterator @iterator end |
#mdarray ⇒ Object (readonly)
Returns the value of attribute mdarray.
597 598 599 |
# File 'lib/mdarray/counter.rb', line 597 def mdarray @mdarray end |
Instance Method Details
#get_current ⇒ Object Also known as: []
646 647 648 |
# File 'lib/mdarray/counter.rb', line 646 def get_current @iterator.getObjectCurrent() end |
#get_current_counter ⇒ Object
Returns the current counter as a ruby array
629 630 631 |
# File 'lib/mdarray/counter.rb', line 629 def get_current_counter @iterator.getCurrentCounter().to_a end |
#get_next ⇒ Object
656 657 658 |
# File 'lib/mdarray/counter.rb', line 656 def get_next @iterator.getObjectNext() end |
#has_next? ⇒ Boolean
613 614 615 |
# File 'lib/mdarray/counter.rb', line 613 def has_next? @iterator.hasNext() end |
#jget_current_counter ⇒ Object
Returns the current counter as a java array. This is for performance improvement. Should be used carefully so that it doesn’t permeate ruby code.
638 639 640 |
# File 'lib/mdarray/counter.rb', line 638 def jget_current_counter @iterator.getCurrentCounter() end |
#next ⇒ Object
621 622 623 |
# File 'lib/mdarray/counter.rb', line 621 def next @iterator.next() end |
#set_current(value) ⇒ Object Also known as: []=
664 665 666 |
# File 'lib/mdarray/counter.rb', line 664 def set_current(value) @iterator.setObjectCurrent(value) end |
#set_next(value) ⇒ Object
674 675 676 |
# File 'lib/mdarray/counter.rb', line 674 def set_next(value) @iterator.setObjectNext(value) end |