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
569 570 571 572 |
# File 'lib/mdarray/counter.rb', line 569 def initialize(mdarray) @mdarray = mdarray @iterator = mdarray.nc_array.getIndexIterator() end |
Instance Attribute Details
#iterator ⇒ Object (readonly)
Returns the value of attribute iterator.
563 564 565 |
# File 'lib/mdarray/counter.rb', line 563 def iterator @iterator end |
#mdarray ⇒ Object (readonly)
Returns the value of attribute mdarray.
562 563 564 |
# File 'lib/mdarray/counter.rb', line 562 def mdarray @mdarray end |
Instance Method Details
#get_current ⇒ Object Also known as: []
611 612 613 |
# File 'lib/mdarray/counter.rb', line 611 def get_current @iterator.getObjectCurrent() end |
#get_current_counter ⇒ Object
Returns the current counter as a ruby array
594 595 596 |
# File 'lib/mdarray/counter.rb', line 594 def get_current_counter @iterator.getCurrentCounter().to_a end |
#get_next ⇒ Object
621 622 623 |
# File 'lib/mdarray/counter.rb', line 621 def get_next @iterator.getObjectNext() end |
#has_next? ⇒ Boolean
578 579 580 |
# File 'lib/mdarray/counter.rb', line 578 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.
603 604 605 |
# File 'lib/mdarray/counter.rb', line 603 def jget_current_counter @iterator.getCurrentCounter() end |
#next ⇒ Object
586 587 588 |
# File 'lib/mdarray/counter.rb', line 586 def next @iterator.next() end |
#set_current(value) ⇒ Object Also known as: []=
629 630 631 |
# File 'lib/mdarray/counter.rb', line 629 def set_current(value) @iterator.setObjectCurrent(value) end |
#set_next(value) ⇒ Object
639 640 641 |
# File 'lib/mdarray/counter.rb', line 639 def set_next(value) @iterator.setObjectNext(value) end |