/** * Get the linked titles for the specified link type. * * @param linkType the link type {@see TdbTitle} for description of link types * @param title the TdbTitle with links * @return a collection of linked titles for the specified type */ public Collection<TdbTitle> getLinkedTdbTitlesForType( TdbTitle.LinkType linkType, TdbTitle title) { if (linkType == null) { throw new IllegalArgumentException("linkType cannot be null"); } if (title == null) { throw new IllegalArgumentException("title cannot be null"); } Collection<String> titleIds = title.getLinkedTdbTitleIdsForType(linkType); if (titleIds.isEmpty()) { return Collections.emptyList(); } ArrayList<TdbTitle> titles = new ArrayList<TdbTitle>(); for (String titleId : titleIds) { TdbTitle aTitle = getTdbTitleById(titleId); if (aTitle != null) { titles.add(aTitle); } } titles.trimToSize(); return titles; }