/** * @see org.sbml.jsbml.SBase#getHistory() * @return */ private History createHistory() { history = new History(); history.parent = this; history.addAllChangeListeners(getListOfTreeNodeChangeListeners()); return history; }
/** * Sets the createdDate. * * @param date * a {@link Date} object representing the date the {@link History} was * created. */ public void setCreatedDate(Date date) { Date oldValue = creation; creation = date; firePropertyChange(TreeNodeChangeEvent.createdDate, oldValue, date); }
@Override public int hashCode() { final int prime = 811; int hashCode = super.hashCode(); if (isSetModifiedDate()) { hashCode += prime * getModifiedDate().hashCode(); } if (isSetCreatedDate()) { hashCode += prime * getCreatedDate().hashCode(); } return hashCode; }
@Override public TreeNode getChildAt(int childIndex) { int pos = 0; if (isSetListOfCreators()) { if (pos == childIndex) { return new TreeNodeAdapter(getListOfCreators(), this); } pos++; } if (isSetListOfModification()) { if (pos == childIndex) { return new TreeNodeAdapter(getListOfModifiedDates(), this); } pos++; } throw new IndexOutOfBoundsException(MessageFormat.format( resourceBundle.getString("IndexExceedsBoundsException"), childIndex, Math.min(pos, 0))); }
if (history.isSetCreatedDate()) w3cdtfNode.insertChild(0, new XMLNode(DateParser.getIsoDateNoMillis(history.getCreatedDate()))); if (history.getModifiedDateCount() > 0) for (Date modifiedDate : history.getListOfModifiedDates())
if (contextObject.getHistory().isSetModifiedDate()) else if (contextObject.getHistory().isSetCreatedDate()) else if (contextObject.getHistory().getCreatorCount() > 0)
contextSBase.getHistory().setCreatedDate(DateParser.parse(w3cdtfDate)); logger.debug("readCreated - created java date = " + contextSBase.getHistory().getCreatedDate());
if (history.getCreatorCount() > 0) int i = 0; for (Creator creator : history.getListOfCreators())
/** * Get the number of {@link Creator} objects in this {@link History}. * * @return the number of {@link Creator}s in this {@link History}. * @libsbml.deprecated use {@link #getCreatorCount()} */ public int getNumCreators() { return getCreatorCount(); }
@Override public History clone() { return new History(this); }
/** * Changes the {@link History} instance to 'history' * * @param history the history to set. */ public void setHistory(History history) { History oldHistory = this.history; this.history = history; this.history.parent = this; this.history.addAllChangeListeners(getListOfTreeNodeChangeListeners()); firePropertyChange(TreeNodeChangeEvent.history, oldHistory, this.history); }
contextSBase.getHistory().addModifiedDate(DateParser.parse(w3cdtfDate));
/** * Creates a new Annotation instance by cloning the given Annotation. * * @param annotation the annotation to be cloned. */ public Annotation(Annotation annotation) { super(annotation); if (annotation.nonRDFannotation != null) { nonRDFannotation = annotation.nonRDFannotation.clone(); } for (CVTerm term : annotation.getListOfCVTerms()) { getListOfCVTerms().add(term.clone()); } if (annotation.isSetHistory()) { setHistory(annotation.getHistory().clone()); } }
contextSBase.getHistory().addCreator(creator); creator.putUserObject(JSBML.READING_IN_PROGRESS, Boolean.TRUE);
if (contextObject.isSetHistory() && contextObject.getHistory().getCreatorCount() > 0) { rdfNode.addNamespace(JSBML.URI_PURL_ELEMENTS, "dc"); rdfNode.addNamespace(Creator.URI_RDF_VCARD_NS, "vCard"); (contextObject.getHistory().isSetCreatedDate() || contextObject.getHistory().isSetModifiedDate()))
@Override public boolean equals(Object object) { // Check all child elements recursively in super class first: boolean equals = super.equals(object); if (equals) { // Cast is possible because super class checks the class attributes History mh = (History) object; equals &= listOfCreators.size() == mh.getListOfCreators().size(); equals &= isSetModifiedDate() == mh.isSetModifiedDate(); if (equals && isSetModifiedDate()) { equals &= getModifiedDate().equals(mh.getModifiedDate()); } equals &= isSetCreatedDate() == mh.isSetCreatedDate(); // isSetCreatedDate() may still be null. if (equals && isSetCreatedDate()) { equals &= getCreatedDate().equals(mh.getCreatedDate()); } } return equals; }
/** * Sets the created of this {@link History} to {@code null}. */ public void unsetCreatedDate() { if (creation != null) { Date oldValue = creation; creation = null; firePropertyChange(TreeNodeChangeEvent.createdDate, oldValue, creation); } }
/** * Creates a {@link History} instance from a given {@link History}. * * @param history */ public History(History history) { super(history); listOfCreators = new ArrayList<Creator>(); for (Creator c : history.getListOfCreators()) { listOfCreators.add(c.clone()); } listOfModification = new ArrayList<Date>(); for (Date d : history.getListOfModifiedDates()) { listOfModification.add((Date) d.clone()); } Calendar calendar = Calendar.getInstance(); if (history.isSetCreatedDate()) { calendar.setTime(history.getCreatedDate()); creation = calendar.getTime(); } if (history.isSetModifiedDate()) { calendar.setTime(history.getModifiedDate()); modified = calendar.getTime(); } }
/** * Sets the created of this {@link History} to {@code null}. */ public void unsetListOfModifiedDates() { if (modified != null) { modified = null; } if (listOfModification != null) { for (Date date : listOfModification) { firePropertyChange(TreeNodeChangeEvent.modifiedDate, date, null); } listOfModification = null; } }
/** * Adds a {@link Creator} instance to this {@link History}. * * @param mc */ public void addCreator(Creator mc) { boolean success = listOfCreators.add(mc); if (success) { mc.parent = this; firePropertyChange(TreeNodeChangeEvent.createdDate, null, mc); } }