/** * 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); }
/** * 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); } }
/** * 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); } }
/** *If there is no i<sup>th</sup> {@link Creator}, it returns {@code null}. * * @param i * @return the {@link Creator} removed from the {@link #listOfCreators}. */ public Creator removeCreator(int i) { Creator c = listOfCreators.remove(i); if (c != null) { firePropertyChange(TreeNodeChangeEvent.creator, c, null); } return c; }
/** * Sets the modifiedDate. * * @param date * a {@link Date} object representing the date the {@link History} was * modified. */ public void setModifiedDate(Date date) { Date oldValue = modified; boolean success = listOfModification.add(date); modified = date; if (success) { firePropertyChange(TreeNodeChangeEvent.modifiedDate, oldValue, modified); } }
/** * If there is no i<sup>th</sup> modified {@link Date}, it returns {@code null}. * * @param i * @return the modified {@link Date} removed from the listOfModification. */ public Date removeModifiedDate(int i) { if (i < listOfModification.size()) { if (i == listOfModification.size() - 1) { if (i - 2 >= 0) { modified = listOfModification.get(i - 2); } else { modified = null; } } Date d = listOfModification.remove(i); if (d != null) { firePropertyChange(TreeNodeChangeEvent.modifiedDate, d, null); } return d; } throw new IndexOutOfBoundsException(MessageFormat.format("No modified date {0,number,integer} available.", i)); }