/** * Factory of the class * * @param id * id of the class Substation to create * @return the class created */ public static Substation create(final String id) { Substation newSubstation = new Substation(); newSubstation.setId(id); return newSubstation; }
/** * Utility to set the "memberOf_SubstationValue" * * @param memberOf_SubstationValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setMemberOf_Substation( Substation memberOf_SubstationValue, boolean setInverse) throws LinkageException { this.memberOf_Substation = memberOf_SubstationValue; this.currentBitset.set(1); if (setInverse) { if (memberOf_SubstationValue != null) { memberOf_SubstationValue.addContains_VoltageLevels(this, false); } } }
/** * 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 } }
cim1.model.SubGeographicalRegion sgr = s.getRegion(); cim1.model.GeographicalRegion gr = sgr.getRegion(); substationsNotAssociatedToValidCountry.add(s.getId()); country = config.getDefaultCountry(); if (newSubstationId == null) { substationId = namingStrategy.getId(s); substationName = s.getName(); } else { cim1.model.Substation newS = cimModel.getId_Substation().get(namingStrategy.getCimId(newSubstationId)); substationId = namingStrategy.getId(newS); substationName = newS.getName(); if (s.getContains_VoltageLevels() != null) { for (cim1.model.VoltageLevel vl : s.getContains_VoltageLevels()) { String voltageLevelId = namingStrategy.getId(vl); VoltageLevel voltageLevel = network.getVoltageLevel(voltageLevelId); LOGGER.warn("Substation {} doesn't contain any voltage level", s.getName());
this.setRegion(attributeToSet, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); this.setRegion(attributeToSetFromBoundary, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); errorMessage.append(idRegion); errorMessage.append("\" in \"Substation\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); errorMessage.append(idRegion); errorMessage.append("\" in \"Substation\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); removeFromUnresolved();
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("Substation "); 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("Substation "); 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, "Substation"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("Substation "); 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);
Substation newSubstation = new Substation(); Substation value = entry.getValue(); newSubstation = value; this.id_Substation.put(newSubstation.getId(), newSubstation); this.allInstances.put(newSubstation.getId(), newSubstation); newMap.put(newSubstation.getId(), newSubstation); this.subsetsInstances.put( .put(newSubstation.getId(), newSubstation);
/** * 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 otherSubstation * the instance to copy */ public void copyBase(final Substation otherSubstation) { // 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 (otherSubstation.currentBitset.get(0)) { SubGeographicalRegion regionAssociation = otherSubstation.getRegion(); //this.idRegion = (regionAssociation != null) ? regionAssociation.getId() : ""; if (regionAssociation != null) { this.idRegion = regionAssociation.getId(); // the proper bit will be set when the setter is called } else { this.idRegion = ""; } } // TODO : Call the parent copy constructor instead ? super.copyBase(otherSubstation); }
message.append(getMessageForConsistency(this.minBitsets.get(subset)));
/** * Copy constructor * The associations with other objects are not copied * * @param Substation * the reference to the class to copy * @return the class constructed */ private Substation(final Substation otherSubstation) { // TODO : check exception safe this.copyBase(otherSubstation); }
/** * 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 Substation clone() { Substation newInstance = new Substation(this); Substation newInstanceSP = newInstance; return newInstanceSP; }
errorMessage.append("Substation "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); errorMessage.append("Substation "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment");
message.append(getMessageForConsistency(this.minBitset));
xmlsw.writeEmptyElement(CIMURI.CIMURI,"SubGeographicalRegion.Substations"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + substations.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder(
this.idMemberOf_Substation = memberOf_SubstationAssociation.getId();