/** * 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(); } }
@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))); }
int i = 0; for (Date modifiedDate : history.getListOfModifiedDates())