java characterdata_Java CharacterData.anySelected方法代码示例

import mesquite.lib.characters.CharacterData; //导入方法依赖的package包/类

public boolean exportFile(MesquiteFile file, String arguments) { //if file is null, consider whole project open to export

writeTaxaWithAllMissing = false;

CharacterData data = findDataToExport(file, arguments);

Taxa t = null;

if (data != null)

t = data.getTaxa();

if (data ==null) {

showLogWindow(true);

logln("WARNING: No suitable data available for export to a file of format \"" + getName() + "\". The file will not be written.\n");

return false;

}

CharacterPartition partition = (CharacterPartition)data.getCurrentSpecsSet(CharacterPartition.class);

Taxa taxa = data.getTaxa();

boolean dataAnySelected = false;

if (data != null)

dataAnySelected =data.anySelected();

if (!MesquiteThread.isScripting())

if (!getExportOptions(dataAnySelected, taxa.anySelected()))

return false;

if (partition==null && !separateCodPos) {

discreetAlert("The data cannot be exported because partitions (character groups) are not assigned, and use of codon positions is not requested.");

return false;

}

int numTaxa = taxa.getNumTaxa();

int numTaxaWrite;

int countTaxa = 0;

for (int it = 0; it

if ((!writeOnlySelectedTaxa || taxa.getSelected(it)) && (writeTaxaWithAllMissing || data.hasDataForTaxon(it)))

countTaxa++;

numTaxaWrite = countTaxa;

int numChars = 0;

StringBuffer outputBuffer = new StringBuffer(numTaxa*(20 + numChars));

if (data != null){

numChars = data.getNumChars();

int numCharWrite = data.numberSelected(this.writeOnlySelectedData);

outputBuffer.append(Integer.toString(numTaxaWrite)+" ");

outputBuffer.append(Integer.toString(numCharWrite)+this.getLineEnding());

int blockSize=50;

exportBlock(taxa, data, outputBuffer, 0, numChars);

}

saveExportedFileWithExtension(outputBuffer, arguments, "phy");

String cfgString = getPartitionFinderCFGText(data, partition, getExportedFileName());

String cfgFilePath = getExportedFilePath();

cfgFilePath=StringUtil.getAllButLastItem(cfgFilePath, MesquiteFile.fileSeparator)+MesquiteFile.fileSeparator+"partition_finder.cfg";

MesquiteFile.putFileContents(cfgFilePath, cfgString, true);

return true;

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值