Class: MDArray::IteratorFast

Inherits:
Object
  • Object
show all
Defined in:
lib/mdarray/counter.rb

Overview



Instance Attribute Summary collapse

Instance Method Summary collapse

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

#iteratorObject (readonly)

Returns the value of attribute iterator.



563
564
565
# File 'lib/mdarray/counter.rb', line 563

def iterator
  @iterator
end

#mdarrayObject (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_currentObject Also known as: []





611
612
613
# File 'lib/mdarray/counter.rb', line 611

def get_current
  @iterator.getObjectCurrent()
end

#get_current_counterObject


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_nextObject





621
622
623
# File 'lib/mdarray/counter.rb', line 621

def get_next
  @iterator.getObjectNext()
end

#has_next?Boolean



Returns:

  • (Boolean)


578
579
580
# File 'lib/mdarray/counter.rb', line 578

def has_next?
  @iterator.hasNext()
end

#jget_current_counterObject


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

#nextObject





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