jrectRef-class: Rectangular java arrays

jrectRef-classR Documentation

Rectangular java arrays

Description

References to java arrays that are guaranteed to be rectangular, i.e similar to R arrays

Objects from the Class

Objects of this class should *not* be created directly. Instead, they usually come as a result of a java method call.

Slots

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

Extends

Class "jarrayRef", directly. Class "jobjRef", by class "jarrayRef", distance 2.

Methods

length

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.

str

signature(object = "jrectRef"): ...

[

signature(x = "jrectRef"): R indexing of rectangular java arrays

dim

signature(x = "jrectRef"): extracts the dimensions of the array

dim<-

signature(x = "jrectRef"): sets the dimensions of the array

unique

signature(x = "jrectRef"): unique objects in the array

duplicated

signature(x = "jrectRef"): see duplicated

anyDuplicated

signature(x = "jrectRef"): see anyDuplicated

sort

signature(x = "jrectRef"): returns a new array with elements from x in order

rev

signature(x = "jrectRef"): returns a new array with elements from x reversed

min

signature(x = "jrectRef"): the smallest object in the array (in the sense of the Comparable interface)

max

signature(x = "jrectRef"): the biggest object in the array (in the sense of the Comparable interface)

range

signature(x = "jrectRef"): the range of the array (in the sense of the Comparable interface)

Examples


v <- new( J("java.util.Vector") )
v$add( "hello" )
v$add( "world" )
v$add( new( J("java.lang.Double"), "10.2" ) )
array <- v$toArray()

array[ c(TRUE,FALSE,TRUE) ]
array[ 1:2 ]
array[ -3 ]

# length
length( array )


# also works as a pseudo field as in java
array$length





rJava documentation built on May 29, 2024, 5:26 a.m.

Related to jrectRef-class in rJava...