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


Java BEASTObject.listInputs方法代码示例

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


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

示例1: testInputTipText

import beast.core.BEASTObject; //导入方法依赖的package包/类
/**
 * Check all inputs of plug-ins have a proper tip text, again
 * to facilitate proper documentation. *
 */
@Test
public void testInputTipText() {
    final List<String> pluginNames = AddOnManager.find(beast.core.BEASTObject.class, AddOnManager.IMPLEMENTATION_DIR);
    final List<String> undocumentedInputs = new ArrayList<String>();
    for (final String beastObjectName : pluginNames) {
        try {
            final BEASTObject beastObject = (BEASTObject) Class.forName(beastObjectName).newInstance();
            final List<Input<?>> inputs = beastObject.listInputs();
            for (final Input<?> input : inputs) {
                boolean hasSatisfactoryDescription = false;
                final String tipText = input.getTipText();
                if (isProperDocString(tipText)) {
                    hasSatisfactoryDescription = true;
                }
                if (!hasSatisfactoryDescription) {
                    undocumentedInputs.add(beastObjectName + ":" + input.getName());
                }
            }
        } catch (Exception e) {
        }
    }

    assertTrue("No proper input tip text (at least " + N_WORDS + " words and " + N_CHARS + " characters) for: "
            + undocumentedInputs.toString(), undocumentedInputs.size() == 0);
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:30,代码来源:DocumentationTest.java

示例2: findAlignments

import beast.core.BEASTObject; //导入方法依赖的package包/类
/**
 * Return first alignment object found underneath BEASTObject obj.
 * 
 * @param obj
 * @return Alignment object if found, null otherwise.
 * @throws IllegalArgumentException
 * @throws IllegalAccessException 
 */
private static Set<Alignment> findAlignments(BEASTObject obj) throws IllegalArgumentException, IllegalAccessException {
   Set<Alignment> alignments = new HashSet<>();

    for (Input input : obj.listInputs()) {
        if (input.get() != null) {
            if (input.get() instanceof Alignment)
                alignments.add((Alignment)input.get());
            if (input.get() instanceof List) {
                for (Object child : (List)input.get()) {
                    if (child instanceof BEASTObject) {
                        alignments.addAll(findAlignments((BEASTObject)child));
                    }
                }
            }
            if (input.get() instanceof BEASTObject) {
                alignments.addAll(findAlignments((BEASTObject)(input.get())));
            }
        }
    }
    return alignments;
}
 
开发者ID:tgvaughan,项目名称:feast,代码行数:30,代码来源:SequenceExtractor.java

示例3: makeJavaDoc

import beast.core.BEASTObject; //导入方法依赖的package包/类
/**
 * print @Description and Input.description info so that it can
 * be inserted in the code before creating Javadoc documentation
 * for the Beast II SDK.
 */
void makeJavaDoc() {
    for (String beastObjectName : m_beastObjectNames) {
        try {
            BEASTObject beastObject = (BEASTObject) Class.forName(beastObjectName).newInstance();
            Log.info.println(beastObjectName + ":@description:" + beastObject.getDescription());
            for (Input<?> input : beastObject.listInputs()) {
                Log.info.println(beastObjectName + ":" + input.getName() + ":" + input.getTipText());
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:19,代码来源:DocMaker.java

示例4: testInputTypeCanBeSet

import beast.core.BEASTObject; //导入方法依赖的package包/类
@Test
public void testInputTypeCanBeSet() throws Exception {
	List<String> beastObjectNames = AddOnManager.find(beast.core.BEASTObject.class,
			AddOnManager.IMPLEMENTATION_DIR);
	List<String> failingInputs = new ArrayList<String>();
	for (String beastObjectName : beastObjectNames) {
		try {
			BEASTObject beastObject = (BEASTObject) Class.forName(beastObjectName).newInstance();
			List<Input<?>> inputs = beastObject.listInputs();
			for (Input<?> input : inputs) {
				if (input.getType() == null) {
					try {
						input.determineClass(beastObject);
						if (input.getType() == null) {
							failingInputs.add(beastObject + ":" + input.getName());
						}
					} catch (Exception e2) {
						failingInputs.add(beastObject + ":" + input.getName());
					}
				}
			}
		} catch (Exception e) {
			// ignore
		}
	}

	assertTrue(
			"Type of input could not be set for these inputs (probably requires to be set by using the appropriate constructure of Input): "
					+ failingInputs.toString(),
			failingInputs.size() == 0);
}
 
开发者ID:CompEvol,项目名称:beast2,代码行数:32,代码来源:InputTypeTest.java


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