Class: Renjin::Logical

Inherits:
Vector show all
Defined in:
lib/JRubyR/logical_value.rb

Instance Attribute Summary

Attributes inherited from Vector

#mdarray

Attributes included from RBSexp

#attr, #rvar, #scope, #sexp

Instance Method Summary collapse

Methods inherited from Vector

#!, #!=, #%, #&, #*, #**, #+, #+@, #-, #-@, #/, #<, #<=, #==, #>, #>=, #as__character, #as__complex, #as__double, #as__integer, #as__mdarray, #atomic?, #character?, #coerce, #complex?, #double?, #eq, #get, #gt, #gz, #initialize, #int_div, #integer?, #l_and, #l_or, #logical?, #numeric?, #xor, #|

Methods included from Index

#[], #[]=, #length, #method_missing, #parse

Methods inherited from RubySexp

build, #fassign, #initialize

Methods included from RBSexp

#destroy, #ncol, #nrow, #pp, #print, #r, #rclass, #sexp?, #typeof, #unbind

Constructor Details

This class inherits a constructor from Renjin::Vector

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Renjin::Index

Instance Method Details

#each(&block) ⇒ Object





38
39
40
41
42
# File 'lib/JRubyR/logical_value.rb', line 38

def each(&block)
  while (@iterator.hasNext())
    block.call((@iterator.next().getInternalValue() == 1)? true : false)
  end
end

#to_stringObject


Renjin bug? toString of a LogicalVector in Renjin is returing a LogicalVector and not a string. Need to take care of this here. to_a converts an Enumerable to an array




50
51
52
# File 'lib/JRubyR/logical_value.rb', line 50

def to_string
  to_a.join(",")
end