@Override
    public List<BelTerm> getSupportingTerms(KamNode kamNode,
            boolean removeDuplicates, NamespaceFilter fltr) {
        if (kamNode == null) throw new InvalidArgument("kamNode", kamNode);
        KamInfo ki = kamNode.getKam().getKamInfo();
        if (!exists(ki)) return null;
        List<BelTerm> terms;
        try {
            terms = kamStoreDao(ki).getSupportingTerms(kamNode, fltr);
        } catch (SQLException e) {
            final String fmt = "error getting supporting terms for %s";
            final String msg = format(fmt, ki.getName());
            throw new KAMStoreException(msg, e);
        }

        // Check for duplicates
        if (removeDuplicates) {
            HashMap<String, BelTerm> map = new HashMap<String, BelTerm>();
            // FIXME: this is inefficient
            for (BelTerm belTerm : terms) {
                if (!map.containsKey(belTerm.getLabel())) {
                    map.put(belTerm.getLabel(), belTerm);
                }
            }
            terms.clear();
            terms.addAll(map.values());
        }
        return terms;
    }
@ Override public List < BelTerm > getSupportingTerms ( KamNode kamNode , boolean removeDuplicates , NamespaceFilter fltr ) { if ( kamNode == null ) throw new InvalidArgument ( "kamNode" , kamNode ) ; KamInfo ki = kamNode . getKam ( ) . getKamInfo ( ) ; if ( ! exists ( ki ) ) return null ; List < BelTerm > terms ; try { terms = kamStoreDao ( ki ) . getSupportingTerms ( kamNode , fltr ) ; } catch ( SQLException e ) { final String fmt = "error getting supporting terms for %s" ; final String msg = format ( fmt , ki . getName ( ) ) ; throw new KAMStoreException ( msg , e ) ; } if ( removeDuplicates ) { HashMap < String , BelTerm > map = new HashMap < String , BelTerm > ( ) ; for ( BelTerm belTerm : terms ) { if ( ! map . containsKey ( belTerm . getLabel ( ) ) ) { map . put ( belTerm . getLabel ( ) , belTerm ) ; } } terms . clear ( ) ; terms . addAll ( map . values ( ) ) ; } return terms ; }
{@inheritDoc}