TConnector-class(Streamer)
TConnector-class()所属R语言包:Streamer
Class "TConnector"
类“TConnector”
译者:生物统计家园网 机器人LoveR
描述----------Description----------
A Consumer-class that is used to connect the output of one stream to several Consumer stream's that perform different operations on the records. The TConnector manages the records supplied to it to ensure that all the streams connected to it get acess to all the records passed to the TConnector irrespective of the number of records processed at a time by each stream connected down-stream.
一个Consumer-类,用于连接一个流的输出几个Consumerstream的记录,执行不同的操作。 TConnector管理提供给它,以确保所有连接到它的流得到一次处理每个数据流连接下游的记录的所有记录传递到TConnector不论接取的记录。
A TConnector can be connected to other Producer and Consumer objects using the connect function.
一个TConnector可以连接到其他Producer人和Consumer使用connect函数的对象。
用法----------Usage----------
TConnector(..., yieldSize=1e6, verbose=FALSE)
参数----------Arguments----------
参数:...
Additional arguments
额外的参数
参数:verbose
logical(1) indicating whether class methods should report to the user.
logical(1)类的方法是否应该报告给用户。
参数:yieldSize
The number of records the input parser is to yield.
输入分析器的记录数是屈服。
构造----------Constructors----------
Use TConnector to construct instances of this class.
使用TConnector建设这个类的实例。
领域----------Fields----------
.records: A temporary buffer used to save records retrieved from the Producer or Consumer class connector up-stream to the TConnector. This field is used internally by class methods
.records:一个临时缓冲区,用于保存的Producer或Consumer类连接器上游TConnector,检索到的记录。此字段用于内部类的方法
.tOuts: A list of objects of class TOut of length equal to the number of streams connected down-stream to it. This field is used internally by the TConnector-class method
.tOuts:一个list类对象的TOut连接下游的流长度等于。此字段用于内部TConnector类的方法
方法----------Methods----------
initialize(...): A method to initialize the fields of the
initialize(...):一个方法来初始化的字段
.fill(): An internal method used to retrieve records from the Producer or Consumer class connected up-stream to the
.fill()“:一个内部方法用于检索记录Producer或Consumer类连接流
.add(): An internal method to add records to the internal
.add():内部的方法,将记录添加到内部
.dump(): An internal method to remove records that have been passed down to all the down-stream classes (and are no longer needed)
.dump():内部的方法来删除记录已向下传递到所有下游类(不再需要)
作者(S)----------Author(s)----------
Nishant Gopalakrishnan <a href="ngopalak@fhcrc.org">ngopalak@fhcrc.org</a>
参见----------See Also----------
stream,YConnector, connect
stream,YConnector,connect
举例----------Examples----------
### Two Streams b, c1 and b, c2 connected with a Tconnector t[#两个流B,C1,C2和B连接与Tconnectorţ]
fl <- system.file("extdata", "s_1_sequence.txt", package="Streamer")
b <- RawInput(fl, 100L, reader=rawReaderFactory(1e4))
### c1 and c2 return different number of records[#C1和C2返回不同的记录数量]
c1 <- RawToChar(10L)
c2 <- RawToChar(20L)
t <- TConnector()
### Connect the blocks together using the connect function[#连接一起使用连接功能块]
blocks <- structure(list(b, c1, c2, t), names = c("b", "c1", "c2", "t"))
df <- data.frame(from =c("b", "t", "t"),
to = c("t", "c1", "c2"))
res <- connect(blocks, df)
### yield on c2 returns 20 records [#C2上产生返回20条记录]
yield(res$c2)
### yield on c1 returns the same records as with yield on c2 [#C1上产生返回C2上的收益相同的记录]
### 10 records at a time[#10时间记录]
yield(res$c1)
yield(res$c1)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|