/** * Factory of the class * * @param id * id of the class ConnectivityNodeContainer to create * @return the class created */ public static ConnectivityNodeContainer create(final String id) { ConnectivityNodeContainer newConnectivityNodeContainer = new ConnectivityNodeContainer(); newConnectivityNodeContainer.setId(id); return newConnectivityNodeContainer; }
/** * Utility to set the "connectivityNodeContainerValue" * * @param connectivityNodeContainerValue * instance to set * @param setInverse * boolean to specify whether to set the inverse association * or not * @throws LinkageException */ public void setConnectivityNodeContainer( ConnectivityNodeContainer connectivityNodeContainerValue, boolean setInverse) throws LinkageException { this.connectivityNodeContainer = connectivityNodeContainerValue; this.currentBitset.set(4); if (setInverse) { if (connectivityNodeContainerValue != null) { connectivityNodeContainerValue.addTopologicalNode(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 } }
/** * 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 (TopologicalNode topologicalNode : this.topologicalNode){ try { xmlsw.writeEmptyElement(CIMURI.CIMURI,"ConnectivityNodeContainer.TopologicalNode"); xmlsw.writeAttribute(CIMModel.rdfURI, "resource", "#" + topologicalNode.getId()); } catch (XMLStreamException e) { StringBuilder errorMessage = new StringBuilder( "Error while trying to write the reference to "); errorMessage.append("ConnectivityNodeContainer "); 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; }
/** * Copy constructor * The associations with other objects are not copied * * @param ConnectivityNodeContainer * the reference to the class to copy * @return the class constructed */ private ConnectivityNodeContainer(final ConnectivityNodeContainer otherConnectivityNodeContainer) { // TODO : check exception safe this.copyBase(otherConnectivityNodeContainer); }
if (super.modelConsistency().isConsistent()) { consistent = consistent && (true); message.append((super.modelConsistency()).getMessage()); } else { consistent = consistent && (false); message.append((super.modelConsistency()).getMessage());
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 ConnectivityNodeContainer clone() { ConnectivityNodeContainer newInstance = new ConnectivityNodeContainer(this); ConnectivityNodeContainer newInstanceSP = newInstance; return newInstanceSP; }
/** * Utility to read a reference to a resource * This function is called by the CIMModel * * @param class_name * the read name of class * @param resource_name * the read name of the associated resource * @param id * the id of the associated resource * @param model * the model this class belongs to * @throws InterpretationException */ @Override public void readResource(final String class_name, final String resource_name, final String id, CIMModel model) throws InterpretationException, LinkageException { if (class_name.equals("EquipmentContainer")) { } else { super.readResource(class_name, resource_name, id, model); } }
/** * 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 ! if (contains_Equipments != null) { contains_Equipments.clear(); } this.currentBitset.clear(0); super.clearContent(subset); }
/** * Utility to read an attribute * This function is called by the CIMModel * * @param class_name * the read name of class * @param attr_name * the read name of attribute * @param value * the read value of the attribute * @param model * the interface to the model this class belongs to * @throws InterpretationException */ @Override public void readAttribute(final String class_name, final String attr_name, final String value, CIMModel model) throws InterpretationException { if (class_name.equals("EquipmentContainer")) { StringBuilder errorMessage = new StringBuilder("The attribute \""); errorMessage.append(attr_name); errorMessage.append("\" in class \""); errorMessage.append(class_name); errorMessage.append("\" could not be found in the model !"); throw new InterpretationException(errorMessage.toString()); } else { super.readAttribute(class_name, attr_name, value, model); } }
message.append(this.getId()); message.append("\" is not consistent in this context:\n");
/** * 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 otherEquipmentContainer * the instance to copy */ public void copyBase(final EquipmentContainer otherEquipmentContainer) { // 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(otherEquipmentContainer); }
if (super.modelConsistency().isConsistent()) { consistent = consistent && (true); message.append((super.modelConsistency(subset)).getMessage()); } else { consistent = consistent && (false); message.append((super.modelConsistency(subset)).getMessage());
message.append(getMessageForConsistency(this.minBitset));
this.idConnectivityNodeContainer = connectivityNodeContainerAssociation.getId();
/** * 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); }