/** * removes the given characted from its children * * @param c the character to remove */ protected void remove(Character c) { TrieNode child; child = m_Children.get(c); remove(child); m_Children.remove(c); }
/** * removes the given characted from its children * * @param c the character to remove */ protected void remove(Character c) { TrieNode child; child = m_Children.get(c); remove(child); m_Children.remove(c); }
/** * Removes a suffix from the trie. * * @param suffix the suffix to remove * @return true if this trie changed as a result of the call */ public boolean remove(String suffix) { boolean result; Character c; String newSuffix; TrieNode child; c = suffix.charAt(0); newSuffix = suffix.substring(1); child = m_Children.get(c); if (child == null) { result = false; } else if (newSuffix.length() == 0) { remove(c); result = true; } else { result = child.remove(newSuffix); if (child.getChildCount() == 0) { remove(child.getChar()); } } return result; }
/** * Removes a suffix from the trie. * * @param suffix the suffix to remove * @return true if this trie changed as a result of the call */ public boolean remove(String suffix) { boolean result; Character c; String newSuffix; TrieNode child; c = suffix.charAt(0); newSuffix = suffix.substring(1); child = m_Children.get(c); if (child == null) { result = false; } else if (newSuffix.length() == 0) { remove(c); result = true; } else { result = child.remove(newSuffix); if (child.getChildCount() == 0) { remove(child.getChar()); } } return result; }
/** * Removes a single instance of the specified element from this collection, if * it is present. * * @param o the object to remove * @return true if this collection changed as a result of the call */ @Override public boolean remove(Object o) { boolean result; result = m_Root.remove(((String) o) + TrieNode.STOP); m_RecalcHashCode = result; return result; }
/** * Removes a single instance of the specified element from this collection, if * it is present. * * @param o the object to remove * @return true if this collection changed as a result of the call */ @Override public boolean remove(Object o) { boolean result; result = m_Root.remove(((String) o) + TrieNode.STOP); m_RecalcHashCode = result; return result; }