@Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (getClass() != obj.getClass()) { return false; } Index other = (Index) obj; if (arrayDimension != other.arrayDimension) { return false; } if (referencedAttribute == null) { if (other.referencedAttribute != null) { return false; } } else if (!referencedAttribute.equals(other.referencedAttribute)) { return false; } return true; }
@Override public int hashCode() { final int prime = 2647; int result = super.hashCode(); result = prime * result + arrayDimension; result = prime * result + ((referencedAttribute == null) ? 0 : referencedAttribute.hashCode()); return result; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { if (attributeName.equals("symbol")) { this.setVariable(value); return true; } } return isAttributeRead; }
@Override public TreeNode getChildAt(int index) { if (index < 0) { throw new IndexOutOfBoundsException(MessageFormat.format( resourceBundle.getString("IndexSurpassesBoundsException"), index, 0)); } int count = super.getChildCount(), pos = 0; if (index < count) { return super.getChildAt(index); } else { index -= count; } // since L3V2, empty ListOf are valid to be written to XML. The check to write them or not is done in the SBMLWriter if (listOfLocalParameters != null) { if (pos == index) { return getListOfLocalParameters(); } pos++; } throw new IndexOutOfBoundsException(MessageFormat.format( resourceBundle.getString("IndexExceedsBoundsException"), index, Math.min(pos, 0))); }
@Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetResultLevel()) { attributes.put(QualConstants.shortLabel + ':' + QualConstants.resultLevel, Integer.toString(getResultLevel())); } return attributes; }
@Override public int getChildCount() { int children = super.getChildCount(); // since L3V2, empty ListOf are valid to be written to XML. The check to write them or not is done in the SBMLWriter if (listOfLocalParameters != null) { children++; } return children; }
@Override public void setMath(ASTNode math) { ASTNode oldMath = this.math; this.math = math; if (oldMath != null) { oldMath.fireNodeRemovedEvent(); } if (this.math != null) { ASTNode.setParentSBMLObject(math, this); firePropertyChange(TreeNodeChangeEvent.math, oldMath, this.math); } }
@Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetVariable()) { attributes.put(TreeNodeChangeEvent.symbol, getVariable()); } return attributes; }
@Override public TreeNode getChildAt(int index) { if (index < 0) { throw new IndexOutOfBoundsException(MessageFormat.format( resourceBundle.getString("IndexSurpassesBoundsException"), index, 0)); } int count = super.getChildCount(), pos = 0; if (index < count) { return super.getChildAt(index); } else { index -= count; } if (isSetMessage()) { if (index == pos) { return getMessage(); } pos++; } throw new IndexOutOfBoundsException(MessageFormat.format( resourceBundle.getString("IndexExceedsBoundsException"), index, Math.min(pos, 0))); }
@Override public int getChildCount() { int count = super.getChildCount(); if (isSetMessage()) { count++; } return count; }
@Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetArrayDimension()) { attributes.remove("arrayDimension"); attributes.put(ArraysConstants.shortLabel + ":arrayDimension", ""+getArrayDimension()); } if (isSetReferencedAttribute()) { attributes.remove("referencedAttribute"); attributes.put(ArraysConstants.shortLabel + ":referencedAttribute", getReferencedAttribute()); } return attributes; }
@Override public int hashCode() { final int prime = 863; int hashCode = super.hashCode(); if (isSetInitialValue()) { hashCode += prime * initialValue.hashCode(); } if (isSetPersistent()) { hashCode += prime * persistent.hashCode(); } return hashCode; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { if (attributeName.equals("variable")) { setVariable(value); return true; } } return isAttributeRead; }
@Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { EventAssignment ea = (EventAssignment) object; equals &= ea.isSetVariable() == isSetVariable(); if (equals && isSetVariable()) { equals &= ea.getVariable().equals(getVariable()); } } return equals; }
@Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetVariable() && getLevel() >= 2) { attributes.put("variable", getVariable()); } return attributes; }
@Override public int hashCode() { final int prime = 853; int hashCode = super.hashCode(); if (isSetVariable()) { hashCode += prime * getVariable().hashCode(); } return hashCode; }
@Override public boolean readAttribute(String attributeName, String prefix, String value) { boolean isAttributeRead = super.readAttribute(attributeName, prefix, value); if (!isAttributeRead) { if (attributeName.equals("timeUnits")) { setTimeUnits(value); return true; } else if (attributeName.equals("substanceUnits")) { setSubstanceUnits(value); return true; } } return isAttributeRead; }
@Override public boolean equals(Object object) { boolean equals = super.equals(object); if (equals) { InitialAssignment in = (InitialAssignment) object; equals &= in.isSetVariable() == isSetVariable(); if (equals && isSetVariable()) { equals &= in.getVariable().equals(getVariable()); } } return equals; }
@Override public Map<String, String> writeXMLAttributes() { Map<String, String> attributes = super.writeXMLAttributes(); if (isSetLevel() && (2 < getLevel())) { if (isSetInitialValue()) { attributes.put("initialValue", Boolean .toString(getInitialValue())); } if (isSetPersistent()) { attributes .put("persistent", Boolean.toString(getPersistent())); } } return attributes; }
@Override public int hashCode() { final int prime = 953; int hashCode = super.hashCode(); if (isDefaultTerm()) { hashCode *= 2; } if (isSetResultLevel()) { hashCode += prime * resultLevel.hashCode(); } return hashCode; }