/** * Factory of the class * * @param id * id of the class FossilFuel to create * @return the class created */ public static FossilFuel create(final String id) { FossilFuel newFossilFuel = new FossilFuel(); newFossilFuel.setId(id); return newFossilFuel; }
/** * Utility to "clear" the content of a class when a subset is invalidated * * @param subset subset to clean */ @Override public void clearContent(Subset subset) { // First of all, we clear the associations: this.clearAssociations(subset); switch (subset) { default: // nothing to clear } }
/** * Copy constructor * The associations with other objects are not copied * * @param FossilFuel * the reference to the class to copy * @return the class constructed */ private FossilFuel(final FossilFuel otherFossilFuel) { // TODO : check exception safe this.copyBase(otherFossilFuel); }
newfossilFuelType = otherFossilFuel.getFossilFuelType(); this.setFossilFuelType(newfossilFuelType); ThermalGeneratingUnit thermalGeneratingUnitAssociation = otherFossilFuel.getThermalGeneratingUnit();
this.setThermalGeneratingUnit(attributeToSet, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); this.setThermalGeneratingUnit(attributeToSetFromBoundary, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); errorMessage.append(idThermalGeneratingUnit); errorMessage.append("\" in \"FossilFuel\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); errorMessage.append(idThermalGeneratingUnit); errorMessage.append("\" in \"FossilFuel\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); removeFromUnresolved();
errorMessage.append("FossilFuel "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "http://iec.ch/TC57/2009/CIM-schema-cim14#FuelType." + getFossilFuelType()); errorMessage.append("FossilFuel "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e);
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("FossilFuel "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); writeClass(xmlsw); super.write(xmlsw, false); errorMessage.append("FossilFuel "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); try { xmlsw.writeStartElement(CIMURI.CIMURI, "FossilFuel"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("FossilFuel "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); writeClass(xmlsw); super.write(xmlsw, subset, false);
FossilFuel attributeToSetFromBoundary = boundaryModel.searchFossilFuel(idFossilFuels); if(attributeToSetFromBoundary != null) { attributeToSetFromBoundary.setFromBoundary(true); try { model.createFossilFuel(idFossilFuels, attributeToSetFromBoundary); throw new LinkageException(e.getMessage()); attributeToSetFromBoundary.resolveLinks(model, boundaryModel); } else { StringBuilder errorMessage = new StringBuilder(
FossilFuel newFossilFuel = new FossilFuel(); FossilFuel value = entry.getValue(); newFossilFuel = value; this.id_FossilFuel.put(newFossilFuel.getId(), newFossilFuel); this.allInstances.put(newFossilFuel.getId(), newFossilFuel); newMap.put(newFossilFuel.getId(), newFossilFuel); this.subsetsInstances.put( .put(newFossilFuel.getId(), newFossilFuel);
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
message.append(getMessageForConsistency(this.minBitsets.get(subset)));
/** * Utility returning a copy of the "base" of this instance * This utility does not copy the associations with other instances * * @return a clone of this instance */ public FossilFuel clone() { FossilFuel newInstance = new FossilFuel(this); FossilFuel newInstanceSP = newInstance; return newInstanceSP; }
/** * Utility to copy the "base" of an other instance of the same class * This utility does not copy the associations with other instances from * the instance to copy * * @param otherThermalGeneratingUnit * the instance to copy */ public void copyBase(final ThermalGeneratingUnit otherThermalGeneratingUnit) { // Memory allocation has done successfully ! // Dropping "old" objects... // This part may change : we do nothing to allow the user to access // object by their id from the global model. if (otherThermalGeneratingUnit.currentBitset.get(0)) { FossilFuel fossilFuelsAssociation = otherThermalGeneratingUnit.getFossilFuels(); //this.idFossilFuels = (fossilFuelsAssociation != null) ? fossilFuelsAssociation.getId() : ""; if (fossilFuelsAssociation != null) { this.idFossilFuels = fossilFuelsAssociation.getId(); // the proper bit will be set when the setter is called } else { this.idFossilFuels = ""; } } // TODO : Call the parent copy constructor instead ? super.copyBase(otherThermalGeneratingUnit); }
message.append(getMessageForConsistency(this.minBitset));