/** * Returns the next element in the iteration. * * @return the next element */ @Override public String next() { String result; result = m_CurrentLeaf.getString(); result = result.substring(0, result.length() - 1); // remove STOP if (m_CurrentLeaf != m_LastLeaf) { m_CurrentLeaf = (TrieNode) m_CurrentLeaf.getNextLeaf(); } else { m_CurrentLeaf = null; } return result; }
/** * Returns the next element in the iteration. * * @return the next element */ @Override public String next() { String result; result = m_CurrentLeaf.getString(); result = result.substring(0, result.length() - 1); // remove STOP if (m_CurrentLeaf != m_LastLeaf) { m_CurrentLeaf = (TrieNode) m_CurrentLeaf.getNextLeaf(); } else { m_CurrentLeaf = null; } return result; }