本文整理了Java中net.ontopia.topicmaps.query.core.QueryResultIF.getValue
方法的一些代码示例,展示了QueryResultIF.getValue
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。QueryResultIF.getValue
方法的具体详情如下:
包路径:net.ontopia.topicmaps.query.core.QueryResultIF
类名称:QueryResultIF
方法名:getValue
[英]PUBLIC: Returns the value in the given column in the current match. The column index is zero-based. Requires next()
to have been called first.
[中]PUBLIC:返回当前匹配项中给定列中的值。列索引是从零开始的。需要先调用next()
。
代码示例来源:origin: net.ontopia/ontopoly-editor
@SuppressWarnings("unchecked")
public T mapRow(QueryResultIF queryResult, int rowno) {
// return the value in the first column
return (T)queryResult.getValue(0);
}
}
代码示例来源:origin: ontopia/ontopia
@Override
public Object getValue(int ix) {
if (inBuffer)
return bufferedRow[ix];
return queryResult.getValue(ix);
}
代码示例来源:origin: ontopia/ontopia
/**
* Get each value of a given column from queryResult, and make a collection
* with the contents of that column.
*/
private Collection getColumn(QueryResultIF queryResult, int column) {
Collection retVal = new ArrayList();
while (queryResult.next()) {
retVal.add(queryResult.getValue(column));
}
return retVal;
}
代码示例来源:origin: ontopia/ontopia
/**
* Bind the variables of a result set to the current row.
*/
protected void bindVariables() throws JspTagException {
for (int i = 0; i < columnNames.length; i++) {
Object currentValue = queryResult.getValue(columnNames[i]);
contextManager.setValue(columnNames[i], currentValue == null
? Collections.EMPTY_LIST
: currentValue);
}
}
代码示例来源:origin: ontopia/ontopia
@Override
public T mapRow(QueryResultIF queryResult, int rowno) {
return wrapValue(queryResult.getValue(0));
}
};
代码示例来源:origin: net.ontopia/ontopia-webed
private void runQuery(ParsedQueryIF query, Map args) throws InvalidQueryException {
log.debug("Running query for: " + args.get("topic"));
QueryResultIF result = query.execute(args);
while (result.next()) {
for (int ix = 0; ix < result.getWidth(); ix++) {
log.debug("Removing: " + result.getValue(ix));
((TMObjectIF) result.getValue(ix)).remove();
}
}
result.close();
}
代码示例来源:origin: net.ontopia/ontopoly-editor
public RoleField mapRow(QueryResultIF result, int rowno) {
TopicIF roleFieldTopic = (TopicIF)result.getValue(0);
return new RoleField(roleFieldTopic, getTopicMap());
}
}, params);
代码示例来源:origin: net.ontopia/ontopoly-editor
public Object mapRow(QueryResultIF queryResult, int rowno) {
Object value = queryResult.getValue(0);
if (value instanceof TopicIF) {
return new Topic((TopicIF)value, getTopicMap());
} else {
return value;
}
}
}, params);
代码示例来源:origin: ontopia/ontopia
@Override
public Object mapRow(QueryResultIF queryResult, int rowno) {
Object value = queryResult.getValue(0);
if (value instanceof TopicIF) {
return new Topic((TopicIF)value, getTopicMap());
} else {
return value;
}
}
}, params);
代码示例来源:origin: net.ontopia/ontopoly-editor
public RoleField mapRow(QueryResultIF result, int rowno) {
TopicIF associationFieldTopic = (TopicIF)result.getValue(0);
TopicIF roleFieldTopic = (TopicIF)result.getValue(1);
TopicIF roleType = (TopicIF)result.getValue(2);
return new RoleField(roleFieldTopic, getTopicMap(), new RoleType(roleType, getTopicMap()), new AssociationField(associationFieldTopic, getTopicMap()));
}
}, params);
代码示例来源:origin: ontopia/ontopia
@Override
public RoleField mapRow(QueryResultIF result, int rowno) {
TopicIF associationFieldTopic = (TopicIF)result.getValue(0);
TopicIF roleFieldTopic = (TopicIF)result.getValue(1);
TopicIF roleType = (TopicIF)result.getValue(2);
return new RoleField(roleFieldTopic, getTopicMap(), new RoleType(roleType, getTopicMap()), new AssociationField(associationFieldTopic, getTopicMap()));
}
}, params);
代码示例来源:origin: ontopia/ontopia
private static Set<TopicIF> queryForSet(TopicMapIF tm, String query)
throws InvalidQueryException {
Set<TopicIF> set = new CompactHashSet<TopicIF>();
QueryProcessorIF proc = QueryUtils.getQueryProcessor(tm);
QueryResultIF result = proc.execute(query);
while (result.next())
set.add((TopicIF) result.getValue(0));
result.close();
return set;
}
代码示例来源:origin: net.ontopia/ontopoly-editor
public FieldsView mapRow(QueryResultIF result, int rowno) {
TopicIF viewTopic = (TopicIF)result.getValue(0);
if (viewTopic == null)
return FieldsView.getDefaultFieldsView(getTopicMap());
else
return new FieldsView(viewTopic, getTopicMap());
}
}, params);
代码示例来源:origin: ontopia/ontopia
@Override
public FieldsView mapRow(QueryResultIF result, int rowno) {
TopicIF viewTopic = (TopicIF)result.getValue(0);
if (viewTopic == null)
return FieldsView.getDefaultFieldsView(getTopicMap());
else
return new FieldsView(viewTopic, getTopicMap());
}
}, params);
代码示例来源:origin: ontopia/ontopia
public Map getMatch(QueryResultIF result) {
Map match = new HashMap();
for (int ix = 0; ix < result.getWidth(); ix++) {
String vname = result.getColumnName(ix);
match.put(vname, result.getValue(ix));
}
return match;
}
代码示例来源:origin: net.ontopia/ontopoly-editor
public NameField mapRow(QueryResultIF result, int rowno) {
TopicIF fieldTopic = (TopicIF)result.getValue(0);
return new NameField(fieldTopic, getTopicMap(), new NameType(getTopicIF(), getTopicMap()));
}
}, params);
代码示例来源:origin: ontopia/ontopia
@Override
public NameField mapRow(QueryResultIF result, int rowno) {
TopicIF fieldTopic = (TopicIF)result.getValue(0);
return new NameField(fieldTopic, getTopicMap(), new NameType(getTopicIF(), getTopicMap()));
}
}, params);
代码示例来源:origin: net.ontopia/ontopoly-editor
public IdentityField mapRow(QueryResultIF result, int rowno) {
TopicIF fieldTopic = (TopicIF)result.getValue(0);
return new IdentityField(fieldTopic, getTopicMap(), new IdentityType(getTopicIF(), getTopicMap()));
}
}, params);
代码示例来源:origin: net.ontopia/ontopoly-editor
public OccurrenceField mapRow(QueryResultIF result, int rowno) {
TopicIF fieldTopic = (TopicIF)result.getValue(0);
return new OccurrenceField(fieldTopic, getTopicMap(), new OccurrenceType(getTopicIF(), getTopicMap()));
}
}, params);
代码示例来源:origin: ontopia/ontopia
@Override
public IdentityField mapRow(QueryResultIF result, int rowno) {
TopicIF fieldTopic = (TopicIF)result.getValue(0);
return new IdentityField(fieldTopic, getTopicMap(), new IdentityType(getTopicIF(), getTopicMap()));
}
}, params);
内容来源于网络,如有侵权,请联系作者删除!