/** * 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 otherBaseVoltage * the instance to copy */ public void copyBase(final BaseVoltage otherBaseVoltage) { boolean newisDC; // assigning primitive type : if (otherBaseVoltage.currentBitset.get(0)) { newisDC = otherBaseVoltage.isDC(); this.setIsDC(newisDC); } float newnominalVoltage; // assigning primitive type : if (otherBaseVoltage.currentBitset.get(3)) { newnominalVoltage = otherBaseVoltage.getNominalVoltage(); this.setNominalVoltage(newnominalVoltage); } // 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. // TODO : Call the parent copy constructor instead ? super.copyBase(otherBaseVoltage); }
/** * Factory of the class * * @param id * id of the class BaseVoltage to create * @return the class created */ public static BaseVoltage create(final String id) { BaseVoltage newBaseVoltage = new BaseVoltage(); newBaseVoltage.setId(id); return newBaseVoltage; }
/** * Utility to set the "baseVoltageValue" * * @param baseVoltageValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setBaseVoltage( BaseVoltage baseVoltageValue, boolean setInverse) throws LinkageException { this.baseVoltage = baseVoltageValue; this.currentBitset.set(1); if (setInverse) { if (baseVoltageValue != null) { baseVoltageValue.addConductingEquipment(this, false); } } }
xmlsw.writeCharacters(String.valueOf(isDC())); xmlsw.writeEndElement(); errorMessage.append("BaseVoltage "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); errorMessage.append("BaseVoltage "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); errorMessage.append("BaseVoltage "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); xmlsw.writeCharacters(String.valueOf(getNominalVoltage())); xmlsw.writeEndElement(); errorMessage.append("BaseVoltage "); 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("BaseVoltage "); 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("BaseVoltage "); 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, "BaseVoltage"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("BaseVoltage "); 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);
BaseVoltage newBaseVoltage = new BaseVoltage(); BaseVoltage value = entry.getValue(); newBaseVoltage = value; this.id_BaseVoltage.put(newBaseVoltage.getId(), newBaseVoltage); this.allInstances.put(newBaseVoltage.getId(), newBaseVoltage); newMap.put(newBaseVoltage.getId(), newBaseVoltage); this.subsetsInstances.put( .put(newBaseVoltage.getId(), newBaseVoltage);
.setName(vl.getName()) .setEnsureIdUnicity(false) .setNominalV(vl.getBaseVoltage().getNominalVoltage()) .setTopologyKind(TopologyKind.BUS_BREAKER) .setLowVoltageLimit(limits[0])
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
message.append(getMessageForConsistency(this.minBitsets.get(subset)));
/** * Copy constructor * The associations with other objects are not copied * * @param BaseVoltage * the reference to the class to copy * @return the class constructed */ private BaseVoltage(final BaseVoltage otherBaseVoltage) { // TODO : check exception safe this.copyBase(otherBaseVoltage); }
/** * 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 BaseVoltage clone() { BaseVoltage newInstance = new BaseVoltage(this); BaseVoltage newInstanceSP = newInstance; return newInstanceSP; }
/** * 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 } }
/** * Utility to set the "baseVoltageValue" * * @param baseVoltageValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setBaseVoltage( BaseVoltage baseVoltageValue, boolean setInverse) throws LinkageException { this.baseVoltage = baseVoltageValue; this.currentBitset.set(0); if (setInverse) { if (baseVoltageValue != null) { baseVoltageValue.addVoltageLevel(this, false); } } }
/** * Utility to set the "baseVoltageValue" * * @param baseVoltageValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setBaseVoltage( BaseVoltage baseVoltageValue, boolean setInverse) throws LinkageException { this.baseVoltage = baseVoltageValue; this.currentBitset.set(8); if (setInverse) { if (baseVoltageValue != null) { baseVoltageValue.addTopologicalNode(this, false); } } }
/** * 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 otherConductingEquipment * the instance to copy */ public void copyBase(final ConductingEquipment otherConductingEquipment) { // 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 (otherConductingEquipment.currentBitset.get(1)) { BaseVoltage baseVoltageAssociation = otherConductingEquipment.getBaseVoltage(); //this.idBaseVoltage = (baseVoltageAssociation != null) ? baseVoltageAssociation.getId() : ""; if (baseVoltageAssociation != null) { this.idBaseVoltage = baseVoltageAssociation.getId(); // the proper bit will be set when the setter is called } else { this.idBaseVoltage = ""; } } // TODO : Call the parent copy constructor instead ? super.copyBase(otherConductingEquipment); }
message.append(getMessageForConsistency(this.minBitset));
this.idBaseVoltage = baseVoltageAssociation.getId();
this.idBaseVoltage = baseVoltageAssociation.getId();