/** * Get the number of {@link Creator} objects in this {@link History}. * * @return the number of {@link Creator}s in this {@link History}. */ public int getCreatorCount() { return isSetListOfCreators() ? listOfCreators.size() : 0; }
@Override public int getChildCount() { int count = 0; if (isSetListOfCreators()) { count ++; } if (isSetListOfModification()) { count++; } return count; }
@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))); }
/** * Checks whether at least one attribute has been set for this * {@link History}. * * @return {@code true} if at least one of the possible attributes is set, i.e., not * null: * <ul> * <li> {@link #creation} date</li> * <li> {@link #listOfCreators} is not null and contains at least one * element</li> * <li> * {@link #listOfModification} is not null and contains at least one * element.</li> * <li> {@link #modified} is not {@code null}.</li> * </ul> */ public boolean isEmpty() { return !isSetCreatedDate() && !isSetListOfCreators() && !isSetListOfModification() && !isSetModifiedDate(); }