jrectRef-class.Rd
References to java arrays that are guaranteed to be rectangular, i.e similar to R arrays
Objects of this class should *not* be created directly. Instead, they usually come as a result of a java method call.
jsig
:JNI signature of the array type
jobj
:Internal identifier of the object
jclass
:Inherited from jobjRef
, but unspecified
dimension
:dimension vector of the array
signature(x = "jrectRef")
: The number of elements in the array.
Note that if the array has more than one dimension,
it gives the number of arrays in the first dimension, and not the total
number of atomic objects in the array (like R does). This gives what would be
returned by array.length
in java.
signature(object = "jrectRef")
: ...
signature(x = "jrectRef")
: R indexing of rectangular java arrays
signature(x = "jrectRef")
: extracts the dimensions of the array
signature(x = "jrectRef")
: sets the dimensions of the array
signature(x = "jrectRef")
: unique objects in the array
signature(x = "jrectRef")
: see duplicated
signature(x = "jrectRef")
: see anyDuplicated
signature(x = "jrectRef")
: returns a new array with elements from x in order
signature(x = "jrectRef")
: returns a new array with elements from x reversed
signature(x = "jrectRef")
: the smallest object in the array (in the sense of the Comparable interface)
signature(x = "jrectRef")
: the biggest object in the array (in the sense of the Comparable interface)
signature(x = "jrectRef")
: the range of the array (in the sense of the Comparable interface)
v <- new( J("java.util.Vector") )
v$add( "hello" )
#> [1] TRUE
v$add( "world" )
#> [1] TRUE
v$add( new( J("java.lang.Double"), "10.2" ) )
#> [1] TRUE
array <- v$toArray()
array[ c(TRUE,FALSE,TRUE) ]
#> [1] "Java-Array-Object[Ljava/lang/Object;:[Ljava.lang.Object;@11e21d0e"
array[ 1:2 ]
#> [1] "Java-Array-Object[Ljava/lang/Object;:[Ljava.lang.Object;@1dd02175"
array[ -3 ]
#> [1] "Java-Array-Object[Ljava/lang/Object;:[Ljava.lang.Object;@31206beb"
# length
length( array )
#> [1] 3
# also works as a pseudo field as in java
array$length
#> [1] 3