accessOp(rJava)
accessOp()所属R语言包:rJava
Field/method operator for Java objects
场/ Java对象的方法操作员
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The $ operator for jobjRef Java object references provides convenience access to object attributes and calling Java methods.
$jobjRefJava对象引用的经营者提供方便的访问对象的属性和调用Java方法。
用法----------Usage----------
## S3 method for class 'jobjRef'
.DollarNames(x, pattern = "" )
## S3 method for class 'jarrayRef'
.DollarNames(x, pattern = "" )
## S3 method for class 'jrectRef'
.DollarNames(x, pattern = "" )
## S3 method for class 'jclassName'
.DollarNames(x, pattern = "" )
参数----------Arguments----------
参数:x
object to complete
对象完成
参数:pattern
pattern
模式
Details
详情----------Details----------
rJava provies two levels of API: low-level JNI-API in the form of .jcall function and high-level reflection API based on the $ operator. The former is very fast, but inflexible. The latter is a convenient way to use Java-like programming at the cost of performance. The reflection API is build around the $ operator on jobjRef-class objects that allows to access Java attributes and call object methods.
rJava provies两个级别的API:低级JNI API.jcall功能和高层次的反射API$运营商的形式。前者是非常快的,但不灵活。后者是一种方便的方法,使用性能为代价的类Java编程。反射API是围绕$jobjRef-class对象的运营商,允许访问的Java属性和调用对象的方法。
$ returns either the value of the attribute or calls a method, depending on which name matches first.
$返回的属性值或调用一个方法,这取决于它的名字相匹配第一。
$<- assigns a value to the corresponding Java attribute.
$<-分配到相应的Java属性的值。
names and .DollarNames returns all fields and methods associated with the object. Method names are followed by ( or () depending on arity. This use of names is mainly useful for code completion, it is not intended to be used programmatically.
names和.DollarNames返回与对象关联的所有领域和方法。其次(或()视元数方法名。这个名称的使用,主要是有用的代码完成,它不打算用于编程。
This is just a convenience API. Internally all calls are mapped into .jcall calls, therefore the calling conventions and returning objects use the same rules. For time-critical Java calls .jcall should be used directly.
这仅仅是一个方便的API。国内所有的电话都映射到.jcall电话,因此调用约定和返回对象使用相同的规则。对于时间紧迫的Java调用.jcall应直接使用。
方法----------Methods----------
$ signature(x = "jobjRef"): ...
$signature(x = "jobjRef"):...
$ signature(x = "jclassName"): ...
$signature(x = "jclassName"):...
$<- signature(x = "jobjRef"): ...
$<-signature(x = "jobjRef"):...
$<- signature(x = "jclassName"): ...
$<-signature(x = "jclassName"):...
names signature(x = "jobjRef"): ...
namessignature(x = "jobjRef"):...
names signature(x = "jarrayRef"): ...
namessignature(x = "jarrayRef"):...
names signature(x = "jrectRef"): ...
namessignature(x = "jrectRef"):...
names signature(x = "jclassName"): ...
namessignature(x = "jclassName"):...
参见----------See Also----------
J, .jcall, .jnew, jobjRef-class
J,.jcall,.jnew,jobjRef-class
举例----------Examples----------
v <- new(J("java.lang.String"), "Hello World!")
v$length()
v$indexOf("World")
names(v)
J("java.lang.String")$valueOf(10)
Double <- J("java.lang.Double")
# the class pseudo field - instance of Class for the associated class[类的伪字段 - 类关联的类的实例]
# similar to java Double.class[类似JAVA Double.class的]
Double$class
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|