Tries to look up each Mapping Candidate in the SNOMED CT db to add more data.
@return the number of Candidates that were enriched
494016
public int enrichXml(final MMOs root) throws SQLException {
        int count = 0;
        // TODO: take out the print statements
        for (final MMO mmo : root.getMMO()) {
            for (final Utterance utterance : mmo.getUtterances().getUtterance()) {
                for (final Phrase phrase : utterance.getPhrases().getPhrase()) {
                    System.out.printf("Phrase: %s\n", phrase.getPhraseText());
                    for (final Mapping mapping : phrase.getMappings().getMapping()) {
                        System.out.printf("Score: %s\n", mapping.getMappingScore());
                        for (final Candidate candidate : mapping.getMappingCandidates().getCandidate()) {
                            final Collection<String> semTypes = new ArrayList<>();
                            for (final SemType st : candidate.getSemTypes().getSemType()) {
                                semTypes.add(st.getvalue());
                            }

                            // the actual line of work
                            count += addSnomedId(candidate) ? 1 : 0;

                            System.out.printf("  %-5s %-9s %s %s %s %s\n",
                                              candidate.getCandidateScore(),
                                              candidate.getCandidateCUI(),
                                              candidate.getSnomedId(),
                                              candidate.getCandidatePreferred(),
                                              semTypes,
                                              candidate.getSources().getSource());
                        }
                    }
                    System.out.println();
                }
            }
        }
        return count;
    }
5047
public int numberOfUpdates() {
        final Integer cachedValue = numberOfUpdatesCache;

        if (cachedValue != null) {
            return cachedValue;
        }

        int numberOfUpdates = 0;

        for (T object : results.keySet()) {
            final PutResult putResult = results.get(object);

            if (putResult.wasUpdated()) {
                //noinspection ConstantConditions
                numberOfUpdates += putResult.numberOfRowsUpdated();
            }
        }

        numberOfUpdatesCache = numberOfUpdates;

        return numberOfUpdates;
    }
1251421
public Map<String, Object> getNamedBindings() {
    ImmutableMap.Builder<String, Object> builder = ImmutableSortedMap.naturalOrder();
    for (Map.Entry<String, Binding> binding : namedBindings.entrySet()) {
      builder.put(binding.getKey(), binding.getValue().getCursorOrValue());
    }
    return builder.build();
  }
249748
protected int getNextNode()
  {
    m_lastFetched = (DTM.NULL == m_lastFetched)
                     ? m_cdtm.getFirstAttribute(m_context)
                     : m_cdtm.getNextAttribute(m_lastFetched);
    return m_lastFetched;
  }
883470
public int numberOfInserts() {
        final Integer cachedValue = numberOfInsertsCache;

        if (cachedValue != null) {
            return cachedValue;
        }

        int numberOfInserts = 0;

        for (T object : results.keySet()) {
            if (results.get(object).wasInserted()) {
                numberOfInserts++;
            }
        }

        numberOfInsertsCache = numberOfInserts;

        return numberOfInserts;
    }
1334888
public int totalCountOfValues() {
        int count = 0;

        for (V v : valueMap.values()) {
            count += v.size();
        }

        return count;
    }
572439
public int getNumberOfTermParameterMappings() {
        int i = 0;
        for (final List<Integer> value : termParameterIndex.values())
            i += value.size();
        return i;
    }
259329
public Map<Integer, String> getPageLinks() {

        Map<Integer, String> links = new TreeMap<Integer, String>();
        if (m_pageCount <= 1) {
            return links;
        }
        int startIndex, endIndex;
        String link = m_cms.getRequestContext().getUri() + m_parameters.toQueryString() + "&searchPage=";
        if (getDisplayPages() < 1) {
            // number of displayed pages not limited, build a map with all available page links
            startIndex = 1;
            endIndex = m_pageCount;
        } else {
            // limited number of displayed pages, calculate page range
            int currentPage = getSearchPage();
            int countBeforeCurrent = getDisplayPages() / 2;
            int countAfterCurrent;
            if ((currentPage - countBeforeCurrent) < 1) {
                // set count before to number of available pages
                countBeforeCurrent = currentPage - 1;
            }
            // set count after to number of remaining pages (- 1 for current page)
            countAfterCurrent = getDisplayPages() - countBeforeCurrent - 1;
            // calculate start and end index
            startIndex = currentPage - countBeforeCurrent;
            endIndex = currentPage + countAfterCurrent;
            // check end index
            if (endIndex > m_pageCount) {
                int delta = endIndex - m_pageCount;
                // decrease start index with delta to get the right number of displayed pages
                startIndex -= delta;
                // check start index to avoid values < 1
                if (startIndex < 1) {
                    startIndex = 1;
                }
                endIndex = m_pageCount;
            }
        }

        // build the sorted tree map of page links
        for (int i = startIndex; i <= endIndex; i++) {
            links.put(new Integer(i), (link + i));
        }
        return links;
    }
896875
private int getMapping(final String mapping, final int revisionCounter)
    {

        String tempA, tempB;

        int length = 0;
        int revC = -1, mapC = -1;
        int index, max = mapping.length();

        while (length < max && revC < revisionCounter) {

            // Read revisionCounter
            index = mapping.indexOf(' ', length);
            tempA = mapping.substring(length, index);
            length = index + 1;

            // Read mappedCounter
            index = mapping.indexOf(' ', length);
            if (index == -1) {
                index = mapping.length();
            }
            tempB = mapping.substring(length, index);
            length = index + 1;

            // Parse values
            revC = Integer.parseInt(tempA);
            mapC = Integer.parseInt(tempB);

            // System.out.println(revC + " -> " + mapC);
        }

        if (revC == revisionCounter) {
            // System.out.println(revC + " >> " + mapC);
            return mapC;
        }

        return revisionCounter;
    }
907081
def GetNextNode(self, modes, innode):
        
        nodes = N.where(self.innodes == innode)

        ## If there's no entry for the given innode, return -1
        if nodes[0].size == 0:
            return -1

        ## If we don't match anything in the modes list, we find the
        ## outnode corresponding the the string 'default'
        defaultindex = N.where(self.keywords[nodes] == 'default')

        if len(defaultindex[0]) != 0:
            outnode = self.outnodes[nodes[0][defaultindex[0]]]

        ## Now try and match one of the strings in the modes list with
        ## the keywords corresponding to the list of entries with the given
        ## innode
        for mode in modes:
            result = self.keywords[nodes].count(mode)
            if result != 0:
                index = N.where(self.keywords[nodes]==mode)
                outnode = self.outnodes[nodes[0][index[0]]]


        ## Return the outnode corresponding either to the matched mode,
        ## or to 'default'
        return outnode
817688
public Enumeration getAll() {
		LinkedList strings = new LinkedList();
		for (Iterator iter = names.iterator(); iter.hasNext();) {
			LdapRdn rdn = (LdapRdn) iter.next();
			strings.add(rdn.getLdapEncoded());
		}

		return Collections.enumeration(strings);
	}
635710
public int computeNextStatementStartKeywordCount() {
        int result = 0;

        if (isNextKeyWord()) {
            for (String[] nextStmtStart : registeredStatementStartPhrases) {
                if (this.matches(nextStmtStart)) {
                    return nextStmtStart.length;
                }
            }
        }

        return result;
    }
662690
public Enumeration<String> getKeys() {
        // lazily load the lookup hashtable.
        if (lookup == null) {
            loadLookup();
        }

        ResourceBundle parent = this.parent;
        return new ResourceBundleEnumeration(lookup.keySet(),
                (parent != null) ? parent.getKeys() : null);
    }
964787
private static int getMapCount(int srcCount, int numNodes) {
    int numMaps = (int)(srcCount / OP_PER_MAP);
    numMaps = Math.min(numMaps, numNodes * MAX_MAPS_PER_NODE);
    return Math.max(numMaps, 1);
  }
960601
public java.util.List<java.util.Map<String, String>> getEntries() {
        if (entries == null) {
            entries = new com.amazonaws.internal.SdkInternalList<java.util.Map<String, String>>();
        }
        return entries;
    }
173026
private int getNextEmptyPosition(){
        int counter;
        for (counter = 0; counter < entries.length; counter++) {
            Entry e = entries[counter];
            if (e.isEmpty()) {
                break;
            }
        }

        if (counter == entries.length) {
            throw new RuntimeException("Entry added to a node which is already full.");
        }

        return counter;
    }
55902
protected int getNextNode()
  {
    if (null != m_exprObj)
    {
      m_lastFetched = m_exprObj.nextNode();
    }
    else
      m_lastFetched = DTM.NULL;

    return m_lastFetched;
  }