本文整理汇总了Java中nl.vu.cs.ajira.data.types.TString.getValue方法的典型用法代码示例。如果您正苦于以下问题:Java TString.getValue方法的具体用法?Java TString.getValue怎么用?Java TString.getValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nl.vu.cs.ajira.data.types.TString
的用法示例。
在下文中一共展示了TString.getValue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: process
import nl.vu.cs.ajira.data.types.TString; //导入方法依赖的package包/类
@Override
public void process(Tuple inputTuple, ActionContext context,
ActionOutput output) throws Exception {
uri = (TString) inputTuple.get(0);
if (currentURI == null || !uri.getValue().equals(currentURI)) {
potentiallyAddPopularURI();
// Reset counter
counter = 0;
currentURI = uri.getValue();
}
// Count the popular URIs
counter++;
}
示例2: process
import nl.vu.cs.ajira.data.types.TString; //导入方法依赖的package包/类
@Override
public void process(Tuple tuple, ActionContext context,
ActionOutput actionOutput) throws Exception {
TString iText = (TString) tuple.get(0);
String sText = iText.getValue();
if (sText != null && sText.length() > 0) {
String[] words = sText.split("\\s+");
for (String word : words) {
if (word.length() > 0) {
TString oWord = new TString(word);
actionOutput.output(oWord, new TInt(1));
}
}
}
}
示例3: process
import nl.vu.cs.ajira.data.types.TString; //导入方法依赖的package包/类
@Override
public void process(Tuple tuple, ActionContext context,
ActionOutput actionOutput) throws Exception {
TString word = (TString) tuple.get(0);
String wordString = word.getValue();
Long currentCount = wordMap.get(wordString);
if (currentCount == null) {
currentCount = 1L;
} else {
currentCount++;
}
wordMap.put(wordString, currentCount);
actionOutput.output(word, new TLong(currentCount));
}
示例4: process
import nl.vu.cs.ajira.data.types.TString; //导入方法依赖的package包/类
@Override
public void process(Tuple tuple, ActionContext context,
ActionOutput actionOutput) throws Exception {
TString iText = (TString) tuple.get(0);
String sText = iText.getValue();
StringTokenizer tok = new StringTokenizer(sText);
while (tok.hasMoreTokens()) {
String word = tok.nextToken();
TString oWord = new TString(word);
actionOutput.output(oWord);
}
}