@Override public int hashCode() { final int prime = 997; int hashCode = super.hashCode(); hashCode += prime * Boolean.valueOf(amount).hashCode(); if (isSetBoundaryCondition()) { hashCode += prime * boundaryCondition.hashCode(); } if (isSetHasOnlySubstanceUnits()) { hashCode += prime * hasOnlySubstanceUnits.hashCode(); } if (isSetCharge()) { hashCode += prime * charge.hashCode(); } if (isSetSpeciesType()) { hashCode += prime * getSpeciesType().hashCode(); } if (isSetCompartment()) { hashCode += prime * getCompartment().hashCode(); } if (isSetSpatialSizeUnits()) { hashCode += prime * getSpatialSizeUnits().hashCode(); } if (isSetConversionFactor()) { hashCode += prime * getConversionFactor().hashCode(); } return hashCode; }
/** * Sets hasOnlySubstanceUnits Boolean * * @param hasOnlySubstanceUnits the has only substance units value to be set * @throws PropertyNotAvailableException if Level < 2. */ public void setHasOnlySubstanceUnits(boolean hasOnlySubstanceUnits) { if (!isReadingInProgress() && getLevel() < 2) { throw new PropertyNotAvailableException( TreeNodeChangeEvent.hasOnlySubstanceUnits, this); } if (!isReadingInProgress() && hasOnlySubstanceUnits && isSetSpatialSizeUnits()) { String ud = isSetUnitsInstance() ? UnitDefinition.printUnits( getSpatialSizeUnitsInstance(), true) : getSpatialSizeUnits(); throw new SBMLException(MessageFormat.format( "Cannot define that species {0} with spatial size units {1} has only substance units.", toString(), ud)); } Boolean oldHasOnlySubstanceUnits = this.hasOnlySubstanceUnits; this.hasOnlySubstanceUnits = Boolean.valueOf(hasOnlySubstanceUnits); isSetHasOnlySubstanceUnits = true; firePropertyChange(TreeNodeChangeEvent.hasOnlySubstanceUnits, oldHasOnlySubstanceUnits, this.hasOnlySubstanceUnits); }
@Override public boolean check(ValidationContext ctx, Species s) { Compartment c = s.getCompartmentInstance(); boolean checkResult = true; if (c != null && c.getSpatialDimensions() == 3 && s.isSetSpatialSizeUnits()) { UnitDefinition def = s.getSpatialSizeUnitsInstance(); if (def == null) { checkResult = false; } boolean isVolume = checkResult && def.isVariantOfVolume(); if (checkResult && ctx.getLevel() == 2 && ctx.getLevel() == 1 && !isVolume) { checkResult = false; } if (checkResult && ctx.getLevel() >= 2 && (! (def.isVariantOfDimensionless() || isVolume))) { checkResult = false; } } if (!checkResult) { // report error ValidationConstraint.logError(ctx, CORE_20607, s, s.getId(), s.getCompartment(), s.getSpatialSizeUnits()); } return checkResult; } };
toString())); } else { attributes.put("spatialSizeUnits", getSpatialSizeUnits());
@Override public boolean check(ValidationContext ctx, Species s) { Compartment c = s.getCompartmentInstance(); boolean checkResult = true; if (c != null && c.getSpatialDimensions() == 1 && s.isSetSpatialSizeUnits()) { UnitDefinition def = s.getSpatialSizeUnitsInstance(); if (def == null) { checkResult = false; } boolean isLength = checkResult && def.isVariantOfLength(); if (ctx.getLevel() == 2 && ctx.getLevel() == 1 && !isLength) { checkResult = false; } if (ctx.getLevel() >= 2 && (! (def.isVariantOfDimensionless() || isLength)) ) { checkResult = false; } } if (!checkResult) { // report error ValidationConstraint.logError(ctx, CORE_20605, s, s.getId(), s.getCompartment(), s.getSpatialSizeUnits()); } return checkResult; } };
setSpatialSizeUnits(new String(species.getSpatialSizeUnits())); } else { spatialSizeUnitsID = species.spatialSizeUnitsID == null ? null : new String(species.spatialSizeUnitsID);
@Override public boolean check(ValidationContext ctx, Species s) { Compartment c = s.getCompartmentInstance(); boolean checkResult = true; if (c != null && c.getSpatialDimensions() == 2 && s.isSetSpatialSizeUnits()) { UnitDefinition def = s.getSpatialSizeUnitsInstance(); if (def == null) { checkResult = false; } boolean isArea = checkResult && def.isVariantOfArea(); if (ctx.getLevel() == 2 && ctx.getLevel() == 1 && !isArea) { checkResult = false; } if (ctx.getLevel() >= 2 && (! (def.isVariantOfDimensionless() || isArea))) { checkResult = false; } } if (!checkResult) { // report error ValidationConstraint.logError(ctx, CORE_20606, s, s.getId(), s.getCompartment(), s.getSpatialSizeUnits()); } return checkResult; } };
bundle.getString("SBMLCoreParser.unknownReferenceError1"), "UnitDefinition", "spatialSizeUnitsID", species.getSpatialSizeUnits(), species.getElementName(), SBMLtools.getIdOrName(species)));
equals &= s.getSpatialSizeUnits().equals(getSpatialSizeUnits());
String unit = ((Species) sb).getSpatialSizeUnits();
sizeUnit = model.getUnitDefinition(getSpatialSizeUnits()); } else { sizeUnit = compartment.getDerivedUnitDefinition();