本文整理汇总了Java中org.sbml.jsbml.ListOf.size方法的典型用法代码示例。如果您正苦于以下问题:Java ListOf.size方法的具体用法?Java ListOf.size怎么用?Java ListOf.size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sbml.jsbml.ListOf
的用法示例。
在下文中一共展示了ListOf.size方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createSampledDomainOrder
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Creates the sampled domain order.
*
* @param losv the losv
*/
private void createSampledDomainOrder(ListOf<SampledVolume> losv){
int numDom = (int) losv.size();
List<Double> sampleList = new ArrayList<Double>();
for(int i = 0; i < numDom ; i++){
sampleList.add(losv.get(i).getSampledValue());
}
Collections.sort(sampleList);
for(int i = 0; i < numDom ; i++){
for(int j = 0 ; j < numDom ; j++){
SampledVolume sv = losv.get(j);
if(sampleList.get(i) == sv.getSampledValue()){
orderedList.add(sv.getDomainType());
}
}
}
}
示例2: addCoordParameter
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Adds the coord parameter.
*/
public void addCoordParameter() {
ListOf<CoordinateComponent> lcc = geometry.getListOfCoordinateComponents();
Parameter p;
CoordinateComponent cc;
for (int i = 0; i < lcc.size(); i++) {
cc = (CoordinateComponent) lcc.get(i);
p = model.createParameter();
p.setId("coordinate" + cc.getSpatialId());
p.setConstant(true);
p.setValue(0d);
SpatialParameterPlugin spp = (SpatialParameterPlugin) p.getPlugin(SpatialConstants.namespaceURI);
SpatialSymbolReference ssr = new SpatialSymbolReference();
ssr.setSpatialRef(cc.getSpatialId());
spp.setParamType(ssr);
}
}
示例3: createImage
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
@Override
protected void createImage(){
ListOf<SampledField> losf = g.getListOfSampledFields();
//TODO : be able create image with multiple sampledfield
if(losf.size() > 1)
System.err.println("not able to compute multiple sampledfields at this point");
SampledField sf = losf.get(0);
if(sf.getDataType() != DataKind.UINT8)
System.err.println("Image data is automatically changed to 8 bit image");
getSize(sf);
getArray(sf);
ImageStack is = createStack();
img.setStack(is);
img.setTitle(title);
}
示例4: unitsToString
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Units to string.
*
* @param lou the lou
* @return the string
*/
private String unitsToString(ListOf<Unit> lou){
StringBuilder sb = new StringBuilder();
for(int i = 0; i< lou.size(); i++){
Unit unit = lou.get(i);
String mul = unit.getMultiplier() == 1 ? "" : String.valueOf(unit.getMultiplier()) + " *";
String scale = unit.getScale() == 0 ? "" : "10^" + unit.getScale() + " *";
String exp = unit.getExponent() == 1 ? "" : "^" + String.valueOf(unit.getExponent());
String kind = SBMLProcessUtil.unitIndexToString(unit.getKind());
sb.append("(" + mul + scale + " " + kind + " )" + exp);
if(i < lou.size() - 1)
sb.append(" * ");
}
return sb.toString();
}
示例5: reorderSpeciesReferencesList
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Reorder species references list.
*
* @param srList
* the sr list
* @return the list
*/
private ListOf<SpeciesReference> reorderSpeciesReferencesList(
ListOf<SpeciesReference> srList) {
SpeciesReference sr = srList.get(0);
SpeciesWrapper sw = mWrapper.getSpeciesWrapperById(sr.getSpecies());
if (sw.getClazz().equals("PROTEIN") || sw.getClazz().equals("GENE")
|| sw.getClazz().equals("RNA") || sw.getClazz().equals("ANTISENSE_RNA")) {
return srList;
}
for (int i = 1; i < srList.size(); i++) {
sr = srList.get(i);
sw = mWrapper.getSpeciesWrapperById(sr.getSpecies());
if (sw.getClazz().equals("PROTEIN") || sw.getClazz().equals("GENE")
|| sw.getClazz().equals("RNA") || sw.getClazz().equals("ANTISENSE_RNA")) {
Collections.swap(srList, 0, i);
}
}
return srList;
}
示例6: createAnalyticDomainOrder
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Creates the analytic domain order.
*
* @param listOf the list of
*/
private void createAnalyticDomainOrder(ListOf<AnalyticVolume> listOf){
int numDom = (int) listOf.size();
for(int i = 0 ; i < numDom ; i++){
for(int j = 0; j < numDom ; j++){
AnalyticVolume av = listOf.get(j);
if(av.getOrdinal() == i){
orderedList.add(av.getDomainType());
}
}
}
}
示例7: addEdge
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Edge.
* TODO change to a better algorithm since this assumes the order of load to be specified
*
* @param load the load
*/
public void addEdge(ListOf<AdjacentDomains> load){
for(int i = 0; i < load.size(); i+=2){
String dom1 = ((AdjacentDomains)load.get(i)).getDomain2();
String dom2 = ((AdjacentDomains)load.get(i+1)).getDomain2();
lod.get(dom1);
if(getOrder(dom1, dom2))
graphStruct.addEdge(dom1, dom2);
else
graphStruct.addEdge(dom2, dom1);
}
}
示例8: addVertex
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Vertex.
*
* @param lod the lod
*/
public void addVertex(ListOf<Domain> lod) {
Domain dom;
for (int i = 0; i < lod.size(); i++) {
dom = lod.get(i);
if(getDomainType(dom.getDomainType()).getSpatialDimensions() == dimension)
graphStruct.addVertex(dom.getSpatialId());
}
}
示例9: createspImgList
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Createsp img list.
*/
protected void createspImgList(){
ListOf<GeometryDefinition> logd = geometry.getListOfGeometryDefinitions();
SpatialImage spImg;
for(int i = 0 ; i < logd.size() ; i++){
GeometryDefinition gd = logd.get(i);
spImg = getSpImgFromGeo(gd);
if(spImg != null)
spImgList.add(spImg);
}
}
示例10: setParameterToList
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Sets the parameter to list.
*
* @param lop the new parameter to list
*/
private void setParameterToList(ListOf<Parameter> lop){
long max = lop.size();
for(int i = 0; i < max; i++){
Parameter p = lop.get(i);
SpatialParameterPlugin sp = (SpatialParameterPlugin) p.getPlugin("spatial");
if(!(sp.getParamType() instanceof DiffusionCoefficient)) continue;
memberList.add(p.clone());
}
}
示例11: getSampledValues
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
@Override
void getSampledValues() {
ListOf<AnalyticVolume> loav = ag.getListOfAnalyticVolumes();
int numDom = (int) loav.size();
int intervalVal = (int) Math.floor(255 / (numDom - 1)); //divide 255 by num of domains excluding EC
for(int i = 0 ; i < numDom ; i++){
AnalyticVolume av = loav.get(i);
hashSampledValue.put(av.getDomainType(), av.getOrdinal() * intervalVal);
}
}
示例12: listIdToStringArray
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* List id to string array.
*
* @param lo the lo
* @return the string[]
*/
public static String[] listIdToStringArray(ListOf<?> lo){
String[] str = new String[(int)lo.size()];
for(int i = 0; i < lo.size(); i++)
str[i] = ((Symbol)lo.get(i)).getId();
return str;
}
示例13: setParameterToList
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Sets the parameter to list.
*
* @param lop the new parameter to list
*/
private void setParameterToList(ListOf<Parameter> lop){
long max = lop.size();
for(int i = 0; i < max; i++){
Parameter p = lop.get(i);
SpatialParameterPlugin sp = (SpatialParameterPlugin) p.getPlugin("spatial");
if(!(sp.getParamType() instanceof AdvectionCoefficient)) continue;
memberList.add(p.clone());
}
}
示例14: setUnitDefinitionToList
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Sets the unit definition to list.
*
* @param loud the new unit definition to list
*/
private void setUnitDefinitionToList(ListOf<UnitDefinition> loud){
long max = loud.size();
for(int i = 0; i < max; i++){
UnitDefinition ud = loud.get(i);
memberList.add(ud.clone());
}
}
示例15: boolSpeciesInSReference
import org.sbml.jsbml.ListOf; //导入方法依赖的package包/类
/**
* Bool species in S reference.
*
* @param los the los
* @param losr the losr
* @return the boolean[]
*/
private boolean[] boolSpeciesInSReference(ListOf<Species> los, ListOf<SpeciesReference> losr){
boolean[] bool = new boolean[(int)los.size()];
for(int i = 0; i < los.size(); i++)
for(int j = 0; j < losr.size(); j++)
if(los.get(i).getId().equals(losr.get(j).getSpecies()))
bool[i] = true;
return bool;
}