/** * Factory of the class * * @param id * id of the class HydroGeneratingUnit to create * @return the class created */ public static HydroGeneratingUnit create(final String id) { HydroGeneratingUnit newHydroGeneratingUnit = new HydroGeneratingUnit(); newHydroGeneratingUnit.setId(id); return newHydroGeneratingUnit; }
/** * 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 HydroGeneratingUnit * the reference to the class to copy * @return the class constructed */ private HydroGeneratingUnit(final HydroGeneratingUnit otherHydroGeneratingUnit) { // TODO : check exception safe this.copyBase(otherHydroGeneratingUnit); }
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("HydroGeneratingUnit "); 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("HydroGeneratingUnit "); 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, "HydroGeneratingUnit"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("HydroGeneratingUnit "); 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);
HydroGeneratingUnit newHydroGeneratingUnit = new HydroGeneratingUnit(); HydroGeneratingUnit value = entry.getValue(); newHydroGeneratingUnit = value; this.id_HydroGeneratingUnit.put(newHydroGeneratingUnit.getId(), newHydroGeneratingUnit); this.allInstances.put(newHydroGeneratingUnit.getId(), newHydroGeneratingUnit); newMap.put(newHydroGeneratingUnit.getId(), newHydroGeneratingUnit); this.subsetsInstances.put( .put(newHydroGeneratingUnit.getId(), newHydroGeneratingUnit);
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 HydroGeneratingUnit clone() { HydroGeneratingUnit newInstance = new HydroGeneratingUnit(this); HydroGeneratingUnit newInstanceSP = newInstance; return newInstanceSP; }
/** * Utility to resolve the links at the end of parsing * * @param model * the model this class belongs to * @param boundaryModel * the model that gather data about the boundarySet, used * as a resource force links resolving * @throws Linkage Exception */ @Override public void resolveLinks(CIMModel model, CIMModel boundaryModel) throws LinkageException { super.resolveLinks(model, boundaryModel); removeFromUnresolved(); }
/** * Utility in charge of creating the message when the class is not * consistent within a specific context * * @param minBitset * bitset describing which CIM attributes of this class have * to be set so that it is consistent within a * specific subset context * @return the message explaining what is not consistent */ private String getMessageForConsistency(final BitSet minBitset) { StringBuilder message = new StringBuilder( "Instance of \"HydroGeneratingUnit\" of id \""); message.append(this.getId()); message.append("\" is not consistent in this context:\n"); /* * XOR and then AND * The result is : * "1" : has not been set and need to be * "0" : has been set or is not mandatory */ BitSet isNotSet = new BitSet(minBitset.length()); isNotSet.or(minBitset); // we create a copy of minBitset isNotSet.xor(this.currentBitset); isNotSet.and(minBitset); return message.toString(); }
message.append(getMessageForConsistency(this.minBitset));