/** * 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 otherOperationalLimitType * the instance to copy */ public void copyBase(final OperationalLimitType otherOperationalLimitType) { // assigning enum type : OperationalLimitDirectionKind newdirection; if (otherOperationalLimitType.currentBitset.get(1)) { newdirection = otherOperationalLimitType.getDirection(); this.setDirection(newdirection); } float newacceptableDuration; // assigning primitive type : if (otherOperationalLimitType.currentBitset.get(2)) { newacceptableDuration = otherOperationalLimitType.getAcceptableDuration(); this.setAcceptableDuration(newacceptableDuration); } // 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(otherOperationalLimitType); }
/** * Factory of the class * * @param id * id of the class OperationalLimitType to create * @return the class created */ public static OperationalLimitType create(final String id) { OperationalLimitType newOperationalLimitType = new OperationalLimitType(); newOperationalLimitType.setId(id); return newOperationalLimitType; }
/** * Utility to set the "operationalLimitTypeValue" * * @param operationalLimitTypeValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setOperationalLimitType( OperationalLimitType operationalLimitTypeValue, boolean setInverse) throws LinkageException { this.operationalLimitType = operationalLimitTypeValue; this.currentBitset.set(1); if (setInverse) { if (operationalLimitTypeValue != null) { operationalLimitTypeValue.addOperationalLimit(this, false); } } }
errorMessage.append("OperationalLimitType "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); errorMessage.append(" in the subset "); errorMessage.append("Equipment"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "http://iec.ch/TC57/2009/CIM-schema-cim14#OperationalLimitDirectionKind." + getDirection()); errorMessage.append("OperationalLimitType "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString()); LOGGER.error(e.toString(), e); if (getAcceptableDuration() != Float.POSITIVE_INFINITY) { xmlsw.writeCharacters(String.valueOf(getAcceptableDuration())); xmlsw.writeEndElement(); errorMessage.append("OperationalLimitType "); errorMessage.append("which ID has been initialized to : "); errorMessage.append(getId()); LOGGER.error(errorMessage.toString());
} else { foundCurrentLimits = true; switch (olt.getName()) { case "PATL": cla.setPermanentLimit(value); break; case "TATL": if (olt.getDirection() != cim1.model.OperationalLimitDirectionKind.absoluteValue) { throw new CIM1Exception("Direction not supported " + olt.getDirection()); int acceptableDuration = (int) olt.getAcceptableDuration(); cla.beginTemporaryLimit() .setName(Integer.toString(acceptableDuration))
xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("OperationalLimitType "); 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("OperationalLimitType "); 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, "OperationalLimitType"); xmlsw.writeAttribute(CIMModel.rdfURI, "ID", getId()); errorMessage.append("OperationalLimitType "); 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);
OperationalLimitType newOperationalLimitType = new OperationalLimitType(); OperationalLimitType value = entry.getValue(); newOperationalLimitType = value; this.id_OperationalLimitType.put(newOperationalLimitType.getId(), newOperationalLimitType); this.allInstances.put(newOperationalLimitType.getId(), newOperationalLimitType); newMap.put(newOperationalLimitType.getId(), newOperationalLimitType); this.subsetsInstances.put( .put(newOperationalLimitType.getId(), newOperationalLimitType);
message.append(getMessageForConsistency(this.minBitsets.get(subset)));
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
/** * Copy constructor * The associations with other objects are not copied * * @param OperationalLimitType * the reference to the class to copy * @return the class constructed */ private OperationalLimitType(final OperationalLimitType otherOperationalLimitType) { // TODO : check exception safe this.copyBase(otherOperationalLimitType); }
/** * 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 OperationalLimitType clone() { OperationalLimitType newInstance = new OperationalLimitType(this); OperationalLimitType 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 } }
cim1.model.OperationalLimitType olt = ol.getOperationalLimitType(); float value; switch (olt.getName()) { case "LowVoltage": value = ((cim1.model.VoltageLimit) ol).getValue();
message.append(getMessageForConsistency(this.minBitset));
this.idOperationalLimitType = operationalLimitTypeAssociation.getId();