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





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

#iteratorObject (readonly)

Returns the value of attribute iterator.



598
599
600
# File 'lib/mdarray/counter.rb', line 598

def iterator
  @iterator
end

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





646
647
648
# File 'lib/mdarray/counter.rb', line 646

def get_current
  @iterator.getObjectCurrent()
end

#get_current_counterObject


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_nextObject





656
657
658
# File 'lib/mdarray/counter.rb', line 656

def get_next
  @iterator.getObjectNext()
end

#has_next?Boolean



Returns:

  • (Boolean)


613
614
615
# File 'lib/mdarray/counter.rb', line 613

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.




638
639
640
# File 'lib/mdarray/counter.rb', line 638

def jget_current_counter
  @iterator.getCurrentCounter()
end

#nextObject





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