本文整理汇总了Java中org.cytoscape.model.CyRow.getTable方法的典型用法代码示例。如果您正苦于以下问题:Java CyRow.getTable方法的具体用法?Java CyRow.getTable怎么用?Java CyRow.getTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.cytoscape.model.CyRow
的用法示例。
在下文中一共展示了CyRow.getTable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: set
import org.cytoscape.model.CyRow; //导入方法依赖的package包/类
public static void set(CyNetwork network, CyIdentifiable entry, String tableName, String name, Object value, Class<?> type) {
CyRow row = network.getRow(entry, tableName);
CyTable table = row.getTable();
CyColumn column = table.getColumn(name);
if (value != null) {
if (column == null) {
if (value instanceof List) {
table.createListColumn(name, type, false);
}
else if (value instanceof Collection) {
throw new IllegalArgumentException("Arrt. values collection is not a List: "
+ value.getClass().getSimpleName());
}
else {
table.createColumn(name, type, false);
}
}
row.set(name, value);
}
}
示例2: serialize
import org.cytoscape.model.CyRow; //导入方法依赖的package包/类
@Override
public void serialize(final CyRow row, JsonGenerator jgen, SerializerProvider provider) throws IOException,
JsonProcessingException {
final CyTable table = row.getTable();
final Map<String, Object> values = row.getAllValues();
for (final String columnName : values.keySet()) {
final Object value = values.get(columnName);
if (value == null)
continue;
Class<?> type = table.getColumn(columnName).getType();
if (type == List.class) {
type = table.getColumn(columnName).getListElementType();
writeList(type, columnName, (List<?>) value, jgen);
} else {
jgen.writeFieldName(replaceColumnName(columnName));
writeValue(type, value, jgen);
}
}
}
示例3: set
import org.cytoscape.model.CyRow; //导入方法依赖的package包/类
public static void set(CyNetwork network, CyIdentifiable entry, String tableName, String name, Object value, Class<?> type) {
CyRow row = network.getRow(entry, tableName);
CyTable table = row.getTable();
CyColumn column = table.getColumn(name);
if (value != null) {
if (column == null) {
if (value instanceof List) {
table.createListColumn(name, type, false);
}
else if (value instanceof Collection) {
throw new IllegalArgumentException("Attribute value is a Collection and not List: "
+ value.getClass().getSimpleName());
}
else {
table.createColumn(name, type, false);
}
}
row.set(name, value);
}
}