当前位置: 首页>>代码示例>>Java>>正文


Java CyColumn.getType方法代码示例

本文整理汇总了Java中org.cytoscape.model.CyColumn.getType方法的典型用法代码示例。如果您正苦于以下问题:Java CyColumn.getType方法的具体用法?Java CyColumn.getType怎么用?Java CyColumn.getType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.cytoscape.model.CyColumn的用法示例。


在下文中一共展示了CyColumn.getType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addColumnName

import org.cytoscape.model.CyColumn; //导入方法依赖的package包/类
/**
 * Adds a column to the current network settings.
 * 
 * @param network
 * @param addedColumnName
 */
public void addColumnName(CyNetwork network, String addedColumnName) {
	CyColumn c = network.getDefaultNodeTable().getColumn(addedColumnName);
	if (c == null)
		return;
	
	if (existsColumn(addedColumnName) && c != null)
		return;

	columnNamesSet.add(addedColumnName);
	columnNames.add(addedColumnName);
	int i = columnNames.size() - 1;

	if (c.getListElementType() == String.class) {
		allGroupColumns.add(i);
		allGroupColumnSizes.add(Constants.CATEGORY_MAX_SIZE);
	} else if (c.getType() == String.class) {
		allStringColumns.add(i);
	} else if (c.getType() == Double.class) {
		allDoubleColumns.add(i);
	}
}
 
开发者ID:ls-cwi,项目名称:eXamine,代码行数:28,代码来源:ControlPanel.java

示例2: isStringColumn

import org.cytoscape.model.CyColumn; //导入方法依赖的package包/类
static boolean isStringColumn(CyColumn column) {
    Class<?> type = column.getType();
    if (type.equals(String.class)) {
        return true;
    }
    if (type.equals(List.class) && column.getListElementType()
                                         .equals(String.class)) {
        return true;
    }
    return false;
}
 
开发者ID:baryshnikova-lab,项目名称:safe-java,代码行数:12,代码来源:SafeUtil.java

示例3: run

import org.cytoscape.model.CyColumn; //导入方法依赖的package包/类
@Override
public void run(TaskMonitor taskMonitor) {
	taskMonitor.setTitle(BuildProperties.APP_NAME);
	taskMonitor.setStatusMessage("Calculating clusterMaker edgeCutOff attribute.");
	
	CyTable table = network.getDefaultEdgeTable();
	CyColumn column = table.getColumn(edgeAttribute);
	
	double min = Double.MAX_VALUE;
	boolean updated = false;
	
	if(column != null) {
		Class<?> type = column.getType();
		if(Number.class.isAssignableFrom(type)) {
			for(CyRow row : table.getAllRows()) {
				Number value = (Number) row.get(edgeAttribute, type);
				if(value != null) {
					double doubleValue = value.doubleValue();
					if(Double.isFinite(doubleValue)) {
						min = Math.min(doubleValue, min);
						updated = true;
					}
				}
			}
		}
	}
	
	result = updated ? min : null;
}
 
开发者ID:BaderLab,项目名称:AutoAnnotateApp,代码行数:30,代码来源:CutoffTask.java

示例4: getEdgeColumnNames

import org.cytoscape.model.CyColumn; //导入方法依赖的package包/类
private List<String> getEdgeColumnNames() {
	List<String> names = new ArrayList<String>();
	names.add("- Select Column -");
	for (CyNetwork network: CyActivator.networkManager.getNetworkSet()) {
		for (CyColumn col:  network.getDefaultEdgeTable().getColumns()) {
			if (!names.contains(col.getName()) &&  (!col.getName().equals("SUID")) &&
					((col.getType() == Double.class) || (col.getType() == Integer.class) || (col.getType() == Long.class))) 
				names.add(col.getName());
		}
	}
	return names;
}
 
开发者ID:DataFusion4NetBio,项目名称:Paper16-SCODE,代码行数:13,代码来源:MyControlPanel.java

示例5: ensemblGeneIds

import org.cytoscape.model.CyColumn; //导入方法依赖的package包/类
/**
 * Return zero or more Ensembl gene ids from the specified Ensembl gene id column for the specified node.
 *
 * @param node node
 * @param network network
 * @param ensemblGeneIdColumn Ensembl gene id column
 * @return zero or more Ensembl gene ids from the specified Ensembl gene id column for the specified node
 */
static Iterable<String> ensemblGeneIds(final CyNode node, final CyNetwork network, final String ensemblGeneIdColumn)
{
    CyTable table = network.getDefaultNodeTable();
    CyRow row = table.getRow(node.getSUID());
    CyColumn column = table.getColumn(ensemblGeneIdColumn);

    if (column != null)
    {
        Class<?> columnClass = column.getType();
        if (String.class.equals(columnClass))
        {
            String ensemblGeneId = row.get(ensemblGeneIdColumn, String.class);
            if (ensemblGeneId != null)
            {
                return ImmutableList.of(ensemblGeneId);
            }
        }
        else if (columnClass.equals(List.class))
        {
            Class<?> listClass = column.getListElementType();
            if (String.class.equals(listClass))
            {
                return row.getList(ensemblGeneIdColumn, String.class);
            }
        }
    }
    return Collections.<String>emptyList();
}
 
开发者ID:heuermh,项目名称:variation-cytoscape3-app,代码行数:37,代码来源:VariationUtils.java

示例6: NetworkSettings

import org.cytoscape.model.CyColumn; //导入方法依赖的package包/类
public NetworkSettings(CyNetwork network) {
	this.networkSUID = network.getSUID();

	// columnNames
	List<CyColumn> columns = new ArrayList<CyColumn>();
	columns.addAll(network.getDefaultNodeTable().getColumns());

	columnNames = new ArrayList<String>(columns.size());

	int i = 0;
	for (CyColumn c : columns) {
		columnNames.add(c.getName());
		columnNamesSet.add(c.getName());

		if (c.getListElementType() == String.class) {
			if (c.getName().equals("Pathway")) {
				selectedGroupColumns.add(allGroupColumns.size());
			}
			allGroupColumns.add(i);
			allGroupColumnSizes.add(Constants.CATEGORY_MAX_SIZE);
		} else if (c.getType() == String.class) {
			if (c.getName().equals("URL")) {
				selectedURLColumn = allStringColumns.size();
			} else if (c.getName().equals("Symbol")) {
				selectedLabelColumn = allStringColumns.size();
			}
			allStringColumns.add(i);
		} else if (c.getType() == Double.class) {
			if (c.getName().equals("Score")) {
				selectedScoreColumn = allDoubleColumns.size();
			}
			allDoubleColumns.add(i);
		}

		i++;
	}
	
	showScore = allDoubleColumns.size() > 0;
}
 
开发者ID:ls-cwi,项目名称:eXamine,代码行数:40,代码来源:ControlPanel.java

示例7: convertCyAttributesToJson

import org.cytoscape.model.CyColumn; //导入方法依赖的package包/类
public static String convertCyAttributesToJson(CyIdentifiable item, CyTable tab){
		String params = "{";
		
		// needs to be rebuild to ensure proper typing!
		
		ObjectMapper mapper = new ObjectMapper();
		
		for(CyColumn cyCol : tab.getColumns()){
			String paramName = cyCol.getName();
			
			if(paramName.equals("neoid"))
				continue;

			Object paramValue = tab.getRow(item.getSUID()).get(cyCol.getName(),cyCol.getType());
			
			System.out.println(paramName + " =  " + paramValue);
			
			String paramValueStr = "";
			if(paramValue == null){
				continue;
			}
			else{
				
				Class<?> colClass = cyCol.getType();
				Class<?> colTypeClass = cyCol.getListElementType();
				
				if(colClass.equals(List.class)){
					paramValueStr = "[";
					
					List<? extends Object> l= tab.getRow(item.getSUID()).getList(cyCol.getName(), cyCol.getListElementType());
					
					Iterator<? extends Object> it = l.iterator();
					
					while(it.hasNext()){
						paramValueStr = paramValueStr + translateToJSON(it.next(),colTypeClass);
						if(it.hasNext()){
							paramValueStr = paramValueStr + ", ";
						}
					}
					
					paramValueStr = paramValueStr + "]";
				} else {
					paramValueStr = paramValueStr + translateToJSON(paramValue,cyCol.getType());
				}
				
//				if(cyCol.getType() == String.class){
//					paramValueStr = "\"" + paramValue.toString() + "\"";
//				} else if(){
//					
//				} else
//				{
//					paramValueStr = paramValue.toString();
//				}
			}

			String jsonParam = "\"" + paramName + "\" : " + paramValueStr + ",";
			params = params + jsonParam;
		}

		params = params.substring(0,params.length()-1);
		params = params + "}";

		return params;
	}
 
开发者ID:gsummer,项目名称:cyNeo4j,代码行数:65,代码来源:CyUtils.java


注:本文中的org.cytoscape.model.CyColumn.getType方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。