本文整理汇总了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);
}
示例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;
}
示例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();
}
}
}
示例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);
}