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


Java ListOf类代码示例

本文整理汇总了Java中org.sbml.jsbml.ListOf的典型用法代码示例。如果您正苦于以下问题:Java ListOf类的具体用法?Java ListOf怎么用?Java ListOf使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ListOf类属于org.sbml.jsbml包,在下文中一共展示了ListOf类的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());		
			}
		}
	}
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:22,代码来源:DomainStruct.java

示例2: getCoordinates

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Gets the coordinates.
 *
 * @return the coordinates
 */
protected void getCoordinates(){
	ListOf<CoordinateComponent> locc = geometry.getListOfCoordinateComponents();
	dimension = (int) locc.size();
	for(int i = 0 ; i < locc.size(); i++){
		CoordinateComponent cc = locc.get(i);
		switch (cc.getType()){
		case cartesianX:
			minCoord.x = ( cc.getBoundaryMinimum().getValue()); maxCoord.x = ( cc.getBoundaryMaximum().getValue());
			break;
		case cartesianY:
			minCoord.y = ( cc.getBoundaryMinimum().getValue()); maxCoord.y = ( cc.getBoundaryMaximum().getValue());
			break;
		case cartesianZ:
			minCoord.z = ( cc.getBoundaryMinimum().getValue()); maxCoord.z = ( cc.getBoundaryMaximum().getValue());
			break;
		}
	}
	
	adjustAxis();
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:26,代码来源:GeometryDatas.java

示例3: orderVolume

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Order volume.
 *
 * @param orderedList the ordered list
 * @param loav the loav
 * @return the array list
 */
private ArrayList<AnalyticVolume> orderVolume(ArrayList<AnalyticVolume> orderedList, ListOf<AnalyticVolume> loav){
	int numDom = (int) loav.size();
	
	for(int i = numDom - 1; i > 0 ; i--){
		AnalyticVolume av;
		for(int j = 0; j < numDom ; j++){
			av = loav.get(j);
			if(av.getOrdinal() == i){
				rearrangeAST(av.getMath());
				orderedList.add(av);
			}
		}
	}
	return orderedList;
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:23,代码来源:AnalyticGeometryData.java

示例4: 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);
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:18,代码来源:SampledFieldGeometryData.java

示例5: 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();
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:23,代码来源:UnitDefinitionTable.java

示例6: 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);
	}
}
 
开发者ID:spatialsimulator,项目名称:XitoSBML,代码行数:20,代码来源:SpatialSBMLExporter.java

示例7: isSetSBOTerm

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Checks if is sets the SBO term.
 *
 * @param document the document
 * @return boolean
 * TODO
 */
public static boolean isSetSBOTerm(SBMLDocument document) {
  boolean species = checkSBOTermFromList(document.getModel().getListOfSpecies());
  boolean compartment = checkSBOTermFromList(document.getModel().getListOfCompartments());
  boolean reaction = checkSBOTermFromList(document.getModel().getListOfReactions());
  ListOf<Reaction> lor = document.getModel().getListOfReactions();
  boolean reactant = true;
  boolean product = true;
  boolean modifier = true;

  for (Reaction r: lor) {
    if (!checkSBOTermFromList(r.getListOfReactants())) {
      reactant = false;
    }
    if (!checkSBOTermFromList(r.getListOfProducts())) {
      product = false;
    }
    if (!checkSBOTermFromList(r.getListOfModifiers())) {
      modifier = false;
    }
  }

  return species && compartment && reaction && reactant && product && modifier;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:31,代码来源:SBMLUtil.java

示例8: 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;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:26,代码来源:Layout2CDConverter.java

示例9: completeUnitDefinitions

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Complete unit definitions.
 *
 * @param unitDefinitions
 *        the unit definitions
 * @return ListOf<UnitDefinition>
 *         TODO
 */
public static ListOf<UnitDefinition> completeUnitDefinitions(
  ListOf<UnitDefinition> unitDefinitions) {
  for (UnitDefinition ud : unitDefinitions) {
    ListOf<Unit> units = ud.getListOfUnits();
    for (Unit u : units) {
      if (!u.isSetExponent()) {
        u.setExponent(1d);
      }
      if (!u.isSetMultiplier()) {
        u.setMultiplier(1d);
      }
      if (!u.isSetKind()) {
        u.setKind(Kind.INVALID);
      }
      if (!u.isSetScale()) {
        u.setScale(0);
      }
    }
  }
  return unitDefinitions;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:30,代码来源:SBMLModelCompleter.java

示例10: completeSpecies

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Complete species.
 *
 * @param species
 *        the species
 * @return ListOf<Species>
 *         TODO
 */
public static ListOf<Species> completeSpecies(ListOf<Species> species) {
  int i = 0;
  for (Species s : species) {
    if (!s.isSetId()) {
      s.setId(s.getClass().getSimpleName() + i++);
    }
    if (!s.isSetCompartment()) {
      s.setCompartment(model.getCompartment(0));
    }
    if (!s.isSetHasOnlySubstanceUnits()) {
      s.setHasOnlySubstanceUnits(true);
    }
    if (!s.isSetBoundaryCondition()) {
      s.setBoundaryCondition(true);
    }
    if (!s.isSetConstant()) {
      s.setConstant(true);
    }
  }
  return species;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:30,代码来源:SBMLModelCompleter.java

示例11: completeReactions

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Complete reactions.
 *
 * @param reactions
 *        the reactions
 * @return ListOf<Reaction>
 *         TODO
 */
public static ListOf<Reaction> completeReactions(ListOf<Reaction> reactions) {
  int i = 0;
  for (Reaction r : reactions) {
    if (!r.isSetId()) {
      r.setId(r.getClass().getSimpleName() + i++);
    }
    if (!r.isSetFast()) {
      r.setFast(true);
    }
    if (!r.isSetReversible()) {
      r.setReversible(true);
    }
    completeSpeciesReference(r.getListOfReactants());
    completeSpeciesReference(r.getListOfProducts());
    completeModifierSpeciesReference(r.getListOfModifiers());
  }
  return reactions;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:27,代码来源:SBMLModelCompleter.java

示例12: completeSpeciesReference

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Complete species reference.
 *
 * @param speciesReference
 *        the species reference
 * @return ListOf<SpeciesReference>
 *         TODO
 */
public static ListOf<SpeciesReference> completeSpeciesReference(
  ListOf<SpeciesReference> speciesReference) {
  for (SpeciesReference sr : speciesReference) {
    if (!sr.isSetSpecies()){
      Species s = model.getSpecies(sr.getId());
      if(s == null) {
        sr.setSpecies(model.getSpecies(0));
      } else {
        sr.setSpecies(s);
      }
    }
    if (!sr.isSetStoichiometry()) {
      sr.setStoichiometry(1d);
    }
    if (!sr.isSetConstant()) {
      sr.setConstant(true);
    }
  }
  return speciesReference;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:29,代码来源:SBMLModelCompleter.java

示例13: createSpeciesReferenceGlyph

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * @param id
 *        the identifier of the {@link SpeciesReferenceGlyph} to be created
 * @param rg
 *        the {@link ReactionGlyph} whose sub-element this species reference
 *        glyph will become
 * @param participants
 *        a list of reaction participants from the corresponding core reaction
 * @param species
 *        the reference to the identifier of the reaction participant from
 *        SBML core
 * @param prefix
 *        the id prefix for the reference of the glyph element
 * @param alias
 *        this is the second component to be concatenated with the prefix to
 *        give the id of the glyph element
 * @param role
 *        the role that this species reference glyph plays within this
 *        reaction glyph.
 * @return the newly creates {@link SpeciesReferenceGlyph}.
 */
public SpeciesReferenceGlyph createSpeciesReferenceGlyph(String id, ReactionGlyph rg, ListOf<? extends SimpleSpeciesReference> participants, String species, String prefix, String alias, SpeciesReferenceRole role) {
  SpeciesReferenceGlyph srg = rg.createSpeciesReferenceGlyph(id);
  SimpleSpeciesReference ssr = SBMLUtil.findReferenceBySpeciesId(participants, species);
  if (ssr != null) {
    if (!ssr.isSetId()) {
      // set the id of each simple species reference when first needed.
      Reaction parent = (Reaction) ssr.getParent().getParent();
      String elementName = participants.getElementName();
      String lType = elementName.substring(6, elementName.length() - 1);
      ssr.setId(parent.getId() + "_" + lType + "_" + (participants.indexOf(ssr) + 1));
    }
    srg.setSpeciesReference(ssr);
  }
  srg.setRole(role);
  srg.setSBOTerm(role.toSBOterm());
  srg.setSpeciesGlyph(prefix + '_' + alias);

  // This initial bounding box is needed for building up the curve, a more precise box will be created later on.
  srg.setBoundingBox(srg.getSpeciesGlyphInstance().getBoundingBox().clone());

  return srg;
}
 
开发者ID:funasoul,项目名称:celldesigner-parser,代码行数:44,代码来源:CD2LayoutConverter.java

示例14: refreshConstraintsPanel

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Refresh constraints panel
 */
public void refreshConstraintsPanel() {
	Model model = bioModel.getSBMLDocument().getModel();
	ListOf<Constraint> listOfConstraints = model.getListOfConstraints();
	String[] cons = new String[model.getConstraintCount()];
	for (int i = 0; i < model.getConstraintCount(); i++) {
		Constraint constraint = listOfConstraints.get(i);
		if (!constraint.isSetMetaId()) {
			String constraintId = "c0";
			int cn = 0;
			while (bioModel.isSIdInUse(constraintId)) {
				cn++;
				constraintId = "c" + cn;
			}
			SBMLutilities.setMetaId(constraint, constraintId);
		}
		cons[i] = constraint.getMetaId() + SBMLutilities.getDimensionString(constraint);
	}
	edu.utah.ece.async.ibiosim.dataModels.biomodel.util.Utility.sort(cons);
	constraints.setListData(cons);
	constraints.setSelectedIndex(0);
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:25,代码来源:Constraints.java

示例15: removeConstraint

import org.sbml.jsbml.ListOf; //导入依赖的package包/类
/**
 * Remove a constraint
 */
public void removeConstraint(String selected) {
	ListOf<Constraint> c = bioModel.getSBMLDocument().getModel().getListOfConstraints();
	for (int i = 0; i < bioModel.getSBMLDocument().getModel().getConstraintCount(); i++) {
		if ((c.get(i).getMetaId()).equals(selected)) {
			c.remove(i);
			break;
		}
	}
	for (int i = 0; i < bioModel.getSBMLCompModel().getListOfPorts().size(); i++) {
		Port port = bioModel.getSBMLCompModel().getListOfPorts().get(i);
		if (port.isSetMetaIdRef() && port.getMetaIdRef().equals(selected)) {
			bioModel.getSBMLCompModel().getListOfPorts().remove(i);
			break;
		}
	}
	Layout layout = bioModel.getLayout();
	if (layout.getListOfAdditionalGraphicalObjects().get(GlobalConstants.GLYPH+"__"+selected)!=null) {
		layout.getListOfAdditionalGraphicalObjects().remove(GlobalConstants.GLYPH+"__"+selected);
	}
	if (layout.getTextGlyph(GlobalConstants.TEXT_GLYPH+"__"+selected) != null) {
		layout.getListOfTextGlyphs().remove(GlobalConstants.TEXT_GLYPH+"__"+selected);
	}
	modelEditor.setDirty(true);
	modelEditor.makeUndoPoint();
}
 
开发者ID:MyersResearchGroup,项目名称:iBioSim,代码行数:29,代码来源:Constraints.java


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