/** * Factory of the class * * @param id * id of the class EquipmentContainer to create * @return the class created */ public static EquipmentContainer create(final String id) { EquipmentContainer newEquipmentContainer = new EquipmentContainer(); newEquipmentContainer.setId(id); return newEquipmentContainer; }
/** * Utility to set the "memberOf_EquipmentContainerValue" * * @param memberOf_EquipmentContainerValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setMemberOf_EquipmentContainer( EquipmentContainer memberOf_EquipmentContainerValue, boolean setInverse) throws LinkageException { this.memberOf_EquipmentContainer = memberOf_EquipmentContainerValue; this.currentBitset.set(1); if (setInverse) { if (memberOf_EquipmentContainerValue != null) { memberOf_EquipmentContainerValue.addContains_Equipments(this, false); } } }
/** * Utility to clear the associations of this class belonging to a * specific subset * * @param subset * the subset from which to clear the associations of this class */ @Override protected void clearAssociations(final Subset subset) { switch (subset) { case StateVariables: { super.clearAssociations(subset); break; } case Topology: { super.clearAssociations(subset); break; } case Equipment: { super.clearAssociations(subset); break; } default: // nothing to clear } }
|| (model.getCurrentSubset() == Subset.Equipment)) { idRegion = id.substring(1); if (!super.isAddedToUnresolved()) { model.addUnresolved(); super.addToUnresolved(); throw new InterpretationException(errorMessage.toString()); } else { super.readResource(class_name, resource_name, id, model);
if (super.modelConsistency().isConsistent()) { consistent = consistent && (true); message.append((super.modelConsistency(subset)).getMessage()); } else { consistent = consistent && (false); message.append((super.modelConsistency(subset)).getMessage());
/** * Copy constructor * The associations with other objects are not copied * * @param EquipmentContainer * the reference to the class to copy * @return the class constructed */ private EquipmentContainer(final EquipmentContainer otherEquipmentContainer) { // TODO : check exception safe this.copyBase(otherEquipmentContainer); }
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 EquipmentContainer clone() { EquipmentContainer newInstance = new EquipmentContainer(this); EquipmentContainer 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); // The function has been called by a concrete class : // the checking has already been done so we can clear everything ! super.clearContent(subset); }
|| (model.getCurrentSubset() == Subset.Equipment)) { idBaseVoltage = id.substring(1); if (!super.isAddedToUnresolved()) { model.addUnresolved(); super.addToUnresolved(); || (model.getCurrentSubset() == Subset.Equipment)) { idMemberOf_Substation = id.substring(1); if (!super.isAddedToUnresolved()) { model.addUnresolved(); super.addToUnresolved(); throw new InterpretationException(errorMessage.toString()); } else { super.readResource(class_name, resource_name, id, model);
if (super.modelConsistency().isConsistent()) { consistent = consistent && (true); message.append((super.modelConsistency()).getMessage()); } else { consistent = consistent && (false); message.append((super.modelConsistency()).getMessage());
/** * 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 otherLine * the instance to copy */ public void copyBase(final Line otherLine) { // 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(otherLine); }
/** * Utility to return the content of this class into the CIM XML format * * @param xmlsw * the stream in which are stored the elements to write */ private void writeClass(XMLStreamWriter xmlsw) { if (currentBitset.get(0)) { for (Equipment contains_Equipments : this.contains_Equipments){ try { xmlsw.writeEmptyElement(CIMURI.CIMURI,"EquipmentContainer.Contains_Equipments"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + contains_Equipments.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the reference to "); errorMessage.append("EquipmentContainer "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("${subsetModel.getSubset($class).getName()}"); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); } } } return; }
message.append(getMessageForConsistency(this.minBitset));
if (super.modelConsistency().isConsistent()) { consistent = consistent && (true); message.append((super.modelConsistency(subset)).getMessage()); } else { consistent = consistent && (false); message.append((super.modelConsistency(subset)).getMessage());
/** * 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); }
super.clearAssociations(subset); break; super.clearAssociations(subset); break; super.clearAssociations(subset); break;
this.idMemberOf_EquipmentContainer = memberOf_EquipmentContainerAssociation.getId();
if (super.modelConsistency().isConsistent()) { consistent = consistent && (true); message.append((super.modelConsistency()).getMessage()); } else { consistent = consistent && (false); message.append((super.modelConsistency()).getMessage());