/** * Factory of the class * * @param id * id of the class ControlAreaGeneratingUnit to create * @return the class created */ public static ControlAreaGeneratingUnit create(final String id) { ControlAreaGeneratingUnit newControlAreaGeneratingUnit = new ControlAreaGeneratingUnit(); newControlAreaGeneratingUnit.setId(id); return newControlAreaGeneratingUnit; }
/** * 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 ControlAreaGeneratingUnit * the reference to the class to copy * @return the class constructed */ private ControlAreaGeneratingUnit(final ControlAreaGeneratingUnit otherControlAreaGeneratingUnit) { // TODO : check exception safe this.copyBase(otherControlAreaGeneratingUnit); }
this.setGeneratingUnit(attributeToSet, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); this.setGeneratingUnit(attributeToSetFromBoundary, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); errorMessage.append(idGeneratingUnit); errorMessage.append("\" in \"ControlAreaGeneratingUnit\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); errorMessage.append(idGeneratingUnit); errorMessage.append("\" in \"ControlAreaGeneratingUnit\" of id \""); errorMessage.append(this.getId()); errorMessage.append("\" !"); throw new LinkageException(errorMessage.toString()); this.setControlArea(attributeToSet, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); this.setControlArea(attributeToSetFromBoundary, setInverse); } catch(LinkageException e) { LOGGER.error(e.toString(), e); errorMessage.append(idControlArea);
GeneratingUnit generatingUnitAssociation = otherControlAreaGeneratingUnit.getGeneratingUnit(); ControlArea controlAreaAssociation = otherControlAreaGeneratingUnit.getControlArea();
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("ControlAreaGeneratingUnit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); writeClass(xmlsw); errorMessage.append("ControlAreaGeneratingUnit "); 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, "ControlAreaGeneratingUnit"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("ControlAreaGeneratingUnit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); writeClass(xmlsw); if (writeID) {
ControlAreaGeneratingUnit newControlAreaGeneratingUnit = new ControlAreaGeneratingUnit(); ControlAreaGeneratingUnit value = entry.getValue(); newControlAreaGeneratingUnit = value; this.id_ControlAreaGeneratingUnit.put(newControlAreaGeneratingUnit.getId(), newControlAreaGeneratingUnit); this.allInstances.put(newControlAreaGeneratingUnit.getId(), newControlAreaGeneratingUnit); newMap.put(newControlAreaGeneratingUnit.getId(), newControlAreaGeneratingUnit); this.subsetsInstances.put( .put(newControlAreaGeneratingUnit.getId(), newControlAreaGeneratingUnit);
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
/** * Utility to check whether this class is consistent according to a subset * * @param subset * the subset defining the context in which to check whether this class is consistent * @return a ConsistencyCheck instance whose boolean attribute (consistent) * indicates if this class is consistent and whose String attribute * (message) * indicates why this class is not consistent if it is not */ @Override public ConsistencyCheck modelConsistency(final Subset subset) { BitSet intersection = new BitSet(this.minBitsets.get(subset).length()); intersection.or(this.minBitsets.get(subset)); // we create a copy of minBitsets.get(subset) intersection.and(this.currentBitset); boolean consistent = (this.minBitsets.get(subset).equals(intersection)); StringBuilder message = new StringBuilder(""); if (!consistent) { message.append(getMessageForConsistency(this.minBitsets.get(subset))); } return new ConsistencyCheck(consistent, message.toString()); }
/** * 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 ControlAreaGeneratingUnit clone() { ControlAreaGeneratingUnit newInstance = new ControlAreaGeneratingUnit(this); ControlAreaGeneratingUnit newInstanceSP = newInstance; return newInstanceSP; }
/** * Utility to add a value within the "controlAreaGeneratingUnit" ArrayList of * "ControlAreaGeneratingUnit" * * @param controlAreaGeneratingUnitValue * value to add within the ArrayList * @param setInverse * boolean to specify whether to set the inverse association or not * @throws LinkageException */ public void addControlAreaGeneratingUnit( ControlAreaGeneratingUnit controlAreaGeneratingUnitValue, boolean setInverse) throws LinkageException { if (controlAreaGeneratingUnit == null) { controlAreaGeneratingUnit = new ArrayList<ControlAreaGeneratingUnit>(); } this.controlAreaGeneratingUnit.add(controlAreaGeneratingUnitValue); this.currentBitset.set(4); if (setInverse) { if (controlAreaGeneratingUnitValue != null) { controlAreaGeneratingUnitValue.setControlArea(this, false); } } }
errorMessage.append("ControlAreaGeneratingUnit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); errorMessage.append("ControlAreaGeneratingUnit "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e);
/** * Utility to check whether this class is consistent in a "merged" context * * @return a ConsistencyCheck instance whose boolean attribute (consistent) * indicates if this class is consistent and whose String attribute * (message) * indicates why this class is not consistent if it is not */ @Override public ConsistencyCheck modelConsistency() { BitSet intersection = new BitSet(this.minBitset.length()); intersection.or(this.minBitset); // we create a copy of minBitSet intersection.and(this.currentBitset); boolean consistent = (this.minBitset.equals(intersection)); StringBuilder message = new StringBuilder(""); if (!consistent) { message.append(getMessageForConsistency(this.minBitset)); } return new ConsistencyCheck(consistent, message.toString()); }
xmlsw.writeEmptyElement(CIMURI.CIMURI,"ControlArea.ControlAreaGeneratingUnit"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + controlAreaGeneratingUnit.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder(
xmlsw.writeEmptyElement(CIMURI.CIMURI,"GeneratingUnit.ControlAreaGeneratingUnit"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + controlAreaGeneratingUnit.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder(